Skip to content

queue: clear next before re-enqueue#170

Open
dacheng-gao wants to merge 1 commit into
mitchellh:mainfrom
dacheng-zig:dacheng/clear-next
Open

queue: clear next before re-enqueue#170
dacheng-gao wants to merge 1 commit into
mitchellh:mainfrom
dacheng-zig:dacheng/clear-next

Conversation

@dacheng-gao

Copy link
Copy Markdown

Probablly fixes #169

@mitchellh

Copy link
Copy Markdown
Owner

Thanks, we're definitely going to need a test to cover this. If you don't get to it I can try eventually

@dacheng-gao

Copy link
Copy Markdown
Author

ping @mitchellh

bryanjeal added a commit to bryanjeal/libxev that referenced this pull request Jun 27, 2026
…xt in submit

Bug mitchellh#209: kqueue tick(0) EV_DELETE flush
- Changed early exit condition from 'if (wait == 0) break' to
  'if (wait == 0 and changes == 0) break' so pending EV_DELETE
  kevent changes from the event-processing loop are flushed
  before tick(0) returns.

Bug mitchellh#170: rearm state correction
- When a non-kqueue completion (close, shutdown, threadpool
  fallback) returns .rearm, set flags.state to .adding before
  pushing to the submissions queue. Previously .dead state
  caused submit() to route through stop_completion (cancel)
  instead of start() (resubmit).

Issue mitchellh#169: defensive next-pointer clear in submit()
- Explicitly clear c.next before push to completions queue
  when processing kevent-returned events in submit(). This
  prevents an assertion failure if a completion is present
  in multiple queues concurrently (race condition).
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.

[bug] v.next is not proper cleared for re-enqueue a completion between different queues

2 participants