diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-28 22:16:45 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-28 22:16:45 +0100 |
| commit | 03d044b88dd1377281caa44c0133d9f22579ba90 (patch) | |
| tree | 216c88a5344c2299c5120b035433e96d1fd2f91a /DESIGN | |
| parent | fdbd31bbb3e61cc42c2d12371975b892934dd51c (diff) | |
Add a generation to a task on the workqueue to prevent its result being sent to the next client reusing the fd
Diffstat (limited to 'DESIGN')
| -rw-r--r-- | DESIGN | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -57,6 +57,13 @@ A socket is read or written, never both. http_interest_set replaces an | |||
| 57 | add-and-drop pair so that the invariant cannot be broken by accident, and the | 57 | add-and-drop pair so that the invariant cannot be broken by accident, and the |
| 58 | event layer hears about a change once instead of twice. | 58 | event layer hears about a change once instead of twice. |
| 59 | 59 | ||
| 60 | A task belongs to a connection, not to a descriptor number. The queue files | ||
| 61 | it under the number, and the kernel hands that number to the next connection | ||
| 62 | the moment this one closes. So a connection that is owed an answer is not | ||
| 63 | read from, closing it cancels every task filed under its number, and a result | ||
| 64 | carries the generation the descriptor had when the task was pushed, which the | ||
| 65 | main loop holds against the current one before it sends anything. | ||
| 66 | |||
| 60 | Accept waits until the client's request has arrived: TCP_DEFER_ACCEPT on | 67 | Accept waits until the client's request has arrived: TCP_DEFER_ACCEPT on |
| 61 | Linux, the accf_data filter on FreeBSD. Measured against a flood of silent | 68 | Linux, the accf_data filter on FreeBSD. Measured against a flood of silent |
| 62 | connections, the filter serves more requests than no filter, not fewer, so it | 69 | connections, the filter serves more requests than no filter, not fewer, so it |
