RFC tipc: notify pending connects of peer node loss
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | tipc: abort pending connects when the peer node is lostnet/ net/ net/ | +72 | 3 replies | |
| 2/2 | selftests: net: cover pending TIPC connects on peer node lossMAINTAINERS tools/ tools/ +1 more | +281 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC net-next 0/2] tipc: notify pending connects of peer node loss
From: liushike <[email protected]>
This series notifies pending active opens when contact with the peer node is lost, and adds selftests for both connection-oriented socket types.
A client can send SYN and wait in connect() while the listening server has not called accept(). If the last usable link then disappears, the unmodified kernel leaves that connect waiting instead of reporting node loss. Registering pending connects lets node_lost_contact() notify them; the client receives EHOSTUNREACH. A surviving link preserves the attempt.
Patch 1 changes connection registration and error notification. Patch 2 adds selftests and their build/maintainer integration.
I am proposing net-next for this long-standing behavior change, but would appreciate guidance on whether net is the preferred target. This is an RFC for review, including the target tree and historical attribution.
I have not reliably identified the original introducing commit for a Fixes tag. Commit dadebc00299a ("tipc: eliminate port_connect()/port_disconnect() functions") moved existing registration logic in 2014; its parent already registered at connection completion, so that refactoring alone is not evidence of introduction. No Fixes tag is guessed here.
Testing used the base-commit below for the before kernel and that base plus this series for the after kernel. Both ran the identical final selftest in x86_64 QEMU/KVM guests (2 vCPUs, 1536 MiB), with GCC 9.4.0 and binutils 2.34. Two network namespaces communicate over veth pairs; fault injection disables TIPC Ethernet bearers, not physical cables.
Results (SOCK_STREAM and SOCK_SEQPACKET, nine cases each):
Before: 8 passed, 10 failed, 0 skipped; exit status 1.
After: 18 passed, 0 failed, 0 skipped; exit status 0.
On the before kernel, last-link loss, both-links loss and named node loss left connect pending beyond the two-second assertion window. Nonblocking connect and connection-wait timeout followed by node loss had no hangup event and SO_ERROR remained zero. Normal accept, surviving-link failover, rejection and named accept passed. These failures occurred after SYN reached the listener, not during topology preparation.
On the after kernel all cases passed, including EHOSTUNREACH and POLLHUP checks for asynchronous failure. The two-second bound is a test deadline, not a measurement of millisecond-level latency.
The kernel configurations differ only in CONFIG_LOCALVERSION. The build records include the base commit, patch and image hashes, configurations, compiler output, launch script and both guest TAP logs.
liushike (2):
tipc: abort pending connects when the peer node is lost
selftests: net: cover pending TIPC connects on peer node loss
MAINTAINERS | 1 + net/tipc/node.c | 37 ++- net/tipc/node.h | 1 + net/tipc/socket.c | 38 ++- tools/testing/selftests/net/Makefile | 1 + tools/testing/selftests/net/config | 1 + tools/testing/selftests/net/tipc_connect.py | 278 ++++++++++++++++++++ 7 files changed, 353 insertions(+), 4 deletions(-) create mode 100755 tools/testing/selftests/net/tipc_connect.py
base-commit: 8830e65ed46de41f849eefb8ba227d4852c460f6
Signature · 1 line
2.34.1