Repository navigation
test(libkernel): wait for the looped-back datagram when polling a reused descriptor - #23266
Merged
oneandonlydean merged 1 commit intoNov 18, 2026
Conversation
PrivacyOnion
approved these changes
Nov 18, 2026
PrivacyOnion
left a comment
Contributor
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 2ce8e34736:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_poll_testsbuilt cleanly. - CTest (
guest_poll):1/1 Test #5641: guest_poll ....................... Passed 4.82 sec 100% tests passed, 0 tests failed out of 1 - Code reading:
- Verified that poll_nid_postfix timeout parameter in milliseconds (1000 ms) safely accommodates loopback datagram delivery latency on non-instantaneous host network stacks without hanging indefinitely.
- Confirmed that GuestPollDescriptor entry retains valid poll flags (events = In) and correctly captures revents & In upon arrival of the looped-back byte.
- Checked that ReusedDescriptorNumberIsPolledFresh socket lifecycle (bind, connect, send, poll, recv, close) remains sound, properly draining the datagram and closing all file descriptors.
- Verified AGENTS.md compliance: no comments were added, no conventions or git diff errors were triggered, and mechanical checks passed cleanly.
Looks Good To Me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ReusedDescriptorNumberIsPolledFreshinguest_pollsends one byte on a UDP socket connected to itself on 127.0.0.1 and then polls it forPOLLINwith a timeout of 0. On macOS the looped-back datagram isn't always readable the momentsendreturns, so the poll sometimes returns 0 and the test aborts at that line.The check is about the reused descriptor number being looked up fresh, not about how fast loopback delivery is. So the poll now waits up to 1000 ms. It returns as soon as the byte arrives, so a host where it is already readable doesn't wait at all. The
selecthalf of the same check inGuestSelect.cppalready waits withGuestTimeval second{1, 0}.On macOS
maindoesn't reach this check today:guest_pollaborts earlier inPollsAResetStream(line 391), which #20161 fixes. With #20161 applied, this check becomes the next failure.Tested
Apple M1, macOS 26.5, Apple clang 21.0.0, x86_64 Release under Rosetta 2,
main245210b07ewith #17425 and #11049 (needed for the macOS build):guest_pollThe one failure in the last row came from the first batch of 20, which didn't record a line. A rerun of 40 with line output had no failures, so I can't say where it came from.
python3 tools/check_conventions.py: passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)