diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-02-04 21:41:35 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-02-25 00:17:38 +0100 |
| commit | 1820103fbbf13df98257a3f5c3ba625de624b0b3 (patch) | |
| tree | 154948479e0a41f55538d68ef5cc7a173e6d27b6 /test | |
| parent | e48ce41a1ec2f05846fb66d3847c2c2b6448ca71 (diff) | |
| download | passt-1820103fbbf13df98257a3f5c3ba625de624b0b3.tar passt-1820103fbbf13df98257a3f5c3ba625de624b0b3.tar.gz passt-1820103fbbf13df98257a3f5c3ba625de624b0b3.tar.bz2 passt-1820103fbbf13df98257a3f5c3ba625de624b0b3.tar.lz passt-1820103fbbf13df98257a3f5c3ba625de624b0b3.tar.xz passt-1820103fbbf13df98257a3f5c3ba625de624b0b3.tar.zst passt-1820103fbbf13df98257a3f5c3ba625de624b0b3.zip | |
tcp: Re-introduce inactivity timeouts based on a clock algorithm
We previously had a mechanism to remove TCP connections which were
inactive for 2 hours. That was broken for a long time, due to poor
interactions with the timerfd handling, so we removed it.
Adding this long scale timer onto the timerfd handling, which mostly
handles much shorter timeouts is tricky to reason about. However, for the
inactivity timeouts, we don't require precision. Instead, we can use
a 1-bit page replacement / "clock" algorithm. Every INACTIVITY_INTERVAL
(2 hours), a global timer marks every TCP connection as tentatively
inactive. That flag is cleared if we get any events, either tap side or
socket side.
If the inactive flag is still set when the next INACTIVITY_INTERVAL expires
then the connection has been inactive for an extended period and we reset
and close it. In practice this means that connections will be removed
after 2-4 hours of inactivity.
This is not a true fix for bug 179, but it does mitigate the damage, by
limiting the time that inactive connections will remain around,
Link: https://bugs.passt.top/show_bug.cgi?id=179
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
