resource-agents icon indicating copy to clipboard operation
resource-agents copied to clipboard

portblock: remove write to tcp_tw_recycle

Open chrboe opened this issue 1 year ago • 1 comments

Currently, the portblock resource agent enables the net.ipv4.tcp_tw_recycle option before sending a tickle ACK packet.

This option is supposed to recycle TCP sockets that are left in the TIME_WAIT state. On the host that initiates the closing of a TCP connection, a socket will be left in this state for about 60 seconds before it finally gets removed (and freed up for further use). This is by design, and it is generally considered useful. [0]

The tcp_tw_recycle option is supposed to shorten the time that a socket spends in the TIME_WAIT state, allowing its slot to be reused more quickly.

Unfortunately, there are no hints left by the previous author about the rationale behind setting this option. One can only guess that they somehow managed to exhaust the number of TCP sockets during testing, and setting this option resolved that immediate issue. It is not entirely clear how this would happen in an actual real-world scenario, since it would require many switchovers in a relatively short period of time.

The problem is that this option has been completely broken starting from Linux 4.10 (since it started randomizing TCP timestamp offsets), and even before that for NAT connections.

Finally, the option has been completely removed in Linux 4.12, which now leads to annoying "No such file or directory" errors whenever the portblock agent runs on a semi-modern kernel.

Thus, remove the line enabling the option.

[0] https://vincent.bernat.ch/en/blog/2014-tcp-time-wait-state-linux

chrboe avatar Mar 25 '24 14:03 chrboe

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/resource-agents/job/resource-agents-pipeline/job/PR-1927/1/input

knet-jenkins[bot] avatar Mar 25 '24 14:03 knet-jenkins[bot]

retest this please

oalbrigt avatar Apr 08 '24 08:04 oalbrigt

Thanks.

oalbrigt avatar Apr 08 '24 09:04 oalbrigt