Skip to content

Fix missing done in IORing.blockingConsumeCompletions - #393

Merged
jrflat merged 1 commit into
apple:mainfrom
jrflat:ioring-consume-completions-undone
Oct 2, 2026
Merged

jrflat merged 1 commit into
apple:mainfrom
jrflat:ioring-consume-completions-undone

Conversation

@jrflat

@jrflat jrflat commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

blockingConsumeCompletions and submitPreparedRequestsAndConsumeCompletions only sent their final done when they had to wait for completions. When enough completions (>= minimumCount) were already in the ring, the functions returned without sending done, so a consumer that relies on it (e.g. to finish a batch) never got it.

This PR moves the consumer(nil, nil, true) call out of the if count < minimumCount branch. The maximumCount and timeout paths send done and return before reaching it, so blockingConsumeCompletions still sends it exactly once.

This also means that with minimumCount: 0 and an empty ring, the consumer now gets a single done. Previously, the consumer wasn't called at all, so this is a behavior change but I believe a good one.

Added test fails without the fix.

@jrflat
jrflat requested a review from FranzBusch October 1, 2026 00:09
@jrflat
jrflat merged commit c3b7f2a into apple:main Oct 2, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants