[DONTMERGE] Test run with reproducer for forced chunked recv #36751

pull optout21 wants to merge 2 commits into bitcoin:master from optout21:2610-net-recv-chunks-reproducer changing 3 files +47 −2
  1. optout21 commented at 7:48 AM on November 4, 2026: contributor

    WARNING: NOT INTENDED FOR MERGING!

    Performing a test run with forced chunked recv.

    All networking code using sockets must not make assumption about the chunking of the incoming/outgoing data, and should be resilient against any chunking. Normally, the chunking of the sends of the writer dictate the chunking of the receives at the reader, but this is not guaranteed by IP/TCP, intermediate networking elements may change the packet structure.

    This branch contains a stress test reproducer. For every socket read, recv() is not called to read all available data, but data is read and returned in smaller chunks. The goal is to test code for robustness in face of unexpected chunking of the data.

    This PR will be closed once the test runs complete, and kept for reference (some tests are expected to fail).

    Similar to #36724 .

    WARNING: NOT INTENDED FOR MERGING!

  2. DrahtBot commented at 7:49 AM on November 4, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  3. optout21 force-pushed on Nov 4, 2026
  4. DrahtBot added the label CI failed on Nov 4, 2026
  5. DrahtBot commented at 7:55 AM on November 4, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task macOS native: https://github.com/bitcoin/bitcoin/actions/runs/41794882715/job/126456522377</sub> <sub>LLM reason (✨ experimental): CI failed because the sock_tests CTest test failed.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  6. optout21 commented at 8:46 AM on November 4, 2026: contributor

    A socket unit test failed (sock_tests/send_and_receive), so integration tests were not executed. Including a commit with a fix for the unit test, for a 2nd run.

    test/sock_tests.cpp(132): error: in "sock_tests/send_and_receive": check receiver.Recv(recv_buf, sizeof(recv_buf), 0) == msg_len has failed [1 != 4]
    test/sock_tests.cpp(133): error: in "sock_tests/send_and_receive": check strncmp(msg, recv_buf, msg_len) == 0 has failed [1 != 0]
    test/sock_tests.cpp(132): error: in "sock_tests/send_and_receive": check receiver.Recv(recv_buf, sizeof(recv_buf), 0) == msg_len has failed [1 != 4]
    test/sock_tests.cpp(133): error: in "sock_tests/send_and_receive": check strncmp(msg, recv_buf, msg_len) == 0 has failed [-1 != 0]
    
  7. optout21 force-pushed on Nov 4, 2026
  8. optout21 commented at 12:55 PM on November 4, 2026: contributor

    CI runs timed out, in some cases a log line is created for every read, and the many small chunks slowed down runs considerably. In local runs this didn't cause a problem. I've changed the reproducer to break up less aggressively: for large streams always read the third of the available data at once. I hope this will make a difference.

  9. optout21 force-pushed on Nov 4, 2026
  10. DONTMERGE! net: Reproducer with forced chunked recv
    A stress test reproducer. For every socket read, read data in smaller
    recv() calls.
    Instead of performing a recv for up to the available buffer size normally,
    break it up into smaller recv()'s, in order to stress test code paths.
    WARNING: Only for testing purposes, not to be merged!
    3914b743b2
  11. test: sock_tests: Fix for case when small chunks are recevied 9c51624165
  12. optout21 force-pushed on Nov 5, 2026
  13. optout21 commented at 11:25 AM on November 5, 2026: contributor

    CI runs have completed, with some failures (as expected).

    Added failed cases to #36726 -- sock_tests/send_and_receive unit test, interface_http.py,feature_torcontrol.py.

    Closing this PR (it was not intended for merging, keeping it for reference).

  14. optout21 closed this on Nov 5, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-14 11:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me