Fix libxev poller callback leaks and re-enable poller tests#442
Merged
heartwilltell merged 1 commit intoApr 28, 2026
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
runlang | e00efbc | Commit Preview URL Branch Preview URL |
Apr 27 2026, 09:58 PM |
e00efbc to
4692255
Compare
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.
Motivation
test_pollercases to be gated (tracked in issues run_xev adapter: multi-fd poll drops second fd's callback #424 and run_xev adapter: inter-test state leak between sequential polls #426).Description
CompletionContextuserdata insrc/runtime/run_xev_bridge.zigso completion callbacks validate the slot generation and ignore stale callbacks from prior fd lifecycles (prevents reuse-related races).&slot.read_ctx/&slot.write_ctxtofile.poll/ write completions, with the callbacks checkingctx.generationbefore acting.run_xev_close_fdby guarding against double-close and draining cancel progress with several bounded non-blocking ticks before clearing slot state to avoid leaving the loop with dangling references.run_xev_tickto perform bounded draining ofloop.run(.no_wait)until no additional callbacks fire in that tick to avoid dropping additional ready fds (fixes multi-fd callback drop).src/runtime/tests/test_poller.c(test_poller_close_while_waiting,test_poller_pipe_read,test_poller_write_park,test_poller_multiple_fds) so the regressions are covered going forward.Testing
zig build test-runtime, but thezigtool was not available in this environment so the runtime tests could not be executed (no automated tests ran here).git diff) and updated test files to re-enable the gated tests; runtime tests should be executed in CI or a developer environment withziginstalled to validate the fixes.Codex Task