Repository navigation
testing/nettest: Add a TCP case for sends that time out on I/O buffers. - #4099
Conversation
|
Testing Claude review ;-) Summary of PR #4099 – testing/nettest: TCP SO_SNDTIMEO / IOB leak test Adds test_tcp_sndtimeo_iob to cmocka_net_tcp (one commit, 5 files, +301/-0). It is the regression test for apache/nuttx#22129 ("mm/iob: Undo the waiter Open review notes:
Overall: clean, small test with correct setup/teardown on skip paths and a |
f6f2364 to
59ed8dc
Compare
|
3e67803 to
9b4a934
Compare
|
Re-review of #4099 (f6f2364 -> 9b4a934, rebased on master) testing/nettest: test_tcp_sndtimeo_iob – regression test for Changes in this push:
Checked: registration in test_tcp.c is nested under CONFIG_NET_IPv4 -> Remaining notes (non-blocking):
Verdict: LGTM once apache/nuttx#22129 is merged. |
test_tcp_sndtimeo_iob: a loopback connection whose reader does not read, and a sender with SO_SNDTIMEO. The sends fill the write buffers, then 10 sends time out in the wait for an I/O buffer. After both ends close, the free I/O buffers in /proc/iobinfo must come back to the number before the test. The case is skipped without /proc/iobinfo, or when a send fails with ENOMEM (no free devif callback: connections of earlier cases in TIME_WAIT can keep theirs). Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
9b4a934 to
a506910
Compare
|
@cederom Pro tip: tell Claude not to be so verbose, so that a human can actually read it :P LLMs are very wordy by default, and it’s unreadable for human |
|
cederom
left a comment
There was a problem hiding this comment.
The only change: the SO_SNDBUF value now has its own int sndbuf instead of reusing the loop counter i. That fixes the nit. Nothing else changed.
These are still open and don't block merging:
- The close order: the sender is closed before the peer that never reads.
- There are more skip paths, so CI logs should show whether the case actually ran.
- A second run in the same boot is skipped because of ENOMEM.
Summary
A new case of
cmocka_net_tcp,test_tcp_sndtimeo_iob: a TCP pair over 127.0.0.1 whose reader does not read, and a sender withSO_SNDTIMEO100 ms. The sends fill the write buffers, then 10 sends time out in the wait for an I/O buffer. After both ends close, the free I/O buffers in/proc/iobinfomust come back to the number before the case (within 3 s).On NuttX master each such timeout keeps one I/O buffer on the committed list; apache/nuttx#22129 fixes it.
The case is built with
CONFIG_NET_IPv4,CONFIG_NET_SOCKOPTSandCONFIG_NET_TCP_WRITE_BUFFERS. The case setsSO_SNDBUFabove what it sends (a stack withoutSO_SNDBUFgivesENOPROTOOPTand has no send limit), so that the sends wait for an I/O buffer and not for the send buffer. It is skipped when the sends do not take the free I/O buffers down toCONFIG_IOB_THROTTLE, without/proc/iobinfo, and when a send fails withENOMEM: with a fixed pool of devif callbacks, the connections of earlier cases in TIME_WAIT can keep the callbacks that the sender needs.Impact
Only
testing/nettest: one new source file and its lines inMakefileandCMakeLists.txt. No change to other cases.Testing
qemu-armv8a:knsh under HVF, 96 IOBs of 196 bytes,
IOB_THROTTLE8, TCP write buffers:test_tcp_sndtimeo_iob, first run after bootcmocka_net_tcpin the same bootENOMEM)ENOMEM)CONFIG_NET_SEND_BUFSIZE=8192Builds in the NuttX CI image with
-Werror, with apache/nuttx#22129, all OK with 0 warnings: qemu-armv8a:netnsh with the case (Make and CMake), sim:tcpblaster with the case, qemu-armv8a:netnsh without TCP write buffers (the case is not built). The knsh images of the runs above build the case atmake import(-Wall, 0 warnings).tools/checkpatch.sh -c -u -m -gpasses.