fix(uring): cancel staged receives on worker drop - #3180
Conversation
Submit staged SQEs before synchronous cancellation, then target only receive and futex operations so staged sends retain their delivery guarantee. Assert through a weak socket observer that teardown drains the receive instead of leaking it after the timeout. Fixes #3173 Co-Authored-By: OpenAI Codex <codex@openai.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8acbeb306f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Queue asynchronous receive and futex cancellations behind their targets so partial submissions retain FIFO cancellation coverage without cancelling staged sends. Bound cancellation staging, submission, completion dispatch, and waits with one teardown deadline, and retry interrupted enters only within that budget. Cover more receives than the submission queue can hold and assert every retained socket is released. Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c151ff6c5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1897867b3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 896bd72322
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48b9dd6928
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5cb9f9cb8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
Summary
EINTRretry budget until the residual SQ is empty or a real error occurs, so staged sends get bounded best-effort delivery.Root cause
Worker teardown issued synchronous cancellation before submitting the SQ. A receive staged in the SQ was therefore invisible to cancellation, then submitted by the teardown pump and left pending until the safety timeout. Cancelling every operation after submission would regress #3141 by dropping staged sends. FIFO asynchronous cancels target only operations that can remain pending indefinitely and stay ordered after their targets even across partial submissions.
Public API changes
None.
Test plan
just rs fix -p moq-uringjust rs check -p moq-uringjust rs test -p moq-uring teardown_submit_interrupt_budget_is_finite(1 passed)just rs test -p moq-uring expired_teardown_submits_residual_sqes(1 passed)just rs test -p moq-uring teardown_stops_between_completions_at_the_deadline(1 passed)just rs test -p moq-uring dropped_worker(2 passed)just rs test -p moq-uring a_send_staged_on_the_way_out_still_goes(1 passed)Closes #3173
(Written by GPT-5)