Skip to content

Reland refactor(core): move nextTick/immediate queues into core, replace ops with shared buffers (#32440)#32465

Merged
bartlomieju merged 4 commits intodenoland:mainfrom
bartlomieju:reland_32440
Mar 4, 2026
Merged

Reland refactor(core): move nextTick/immediate queues into core, replace ops with shared buffers (#32440)#32465
bartlomieju merged 4 commits intodenoland:mainfrom
bartlomieju:reland_32440

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • The nextTick rewrite (refactor(core): move nextTick/immediate queues into core, replace ops with shared buffers #32440) moved unhandled rejection processing into processTicksAndRejections (JS-side processPromiseRejections), but rejectionhandled events were still only dispatched from Rust's dispatch_rejections, which runs after tick draining. This caused rejectionhandled to fire after unhandledrejection for later promises, breaking expected event ordering.
  • Extracted dispatch_handled_rejections from dispatch_rejections and call it before both the tick drain in the main event loop and between timer callbacks in dispatch_timers.
  • Fixes deno_core_testing::integration::error_rejection_catch.

Test plan

  • cargo nextest run -p deno_core — all 354 tests pass
  • cargo nextest run -p deno_core_testing — all 54 tests pass (including previously failing error_rejection_catch)

🤖 Generated with Claude Code

bartlomieju and others added 2 commits March 4, 2026 16:58
…lace ops with shared buffers (denoland#32440)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The nextTick rewrite moved unhandled rejection processing into
processTicksAndRejections (JS-side), but "rejectionhandled" events
were still only dispatched from Rust's dispatch_rejections, which
runs after tick draining. This caused rejectionhandled to fire after
unhandledrejection for later promises, breaking the expected ordering.

Fix by extracting dispatch_handled_rejections and calling it before
both the tick drain in the event loop and between timer callbacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bartlomieju bartlomieju changed the title fix(core): dispatch rejectionhandled before unhandledrejection reland: refactor(core): move nextTick/immediate queues into core, replace ops with shared buffers (#32440) Mar 4, 2026
@bartlomieju bartlomieju changed the title reland: refactor(core): move nextTick/immediate queues into core, replace ops with shared buffers (#32440) Reland refactor(core): move nextTick/immediate queues into core, replace ops with shared buffers (#32440) Mar 4, 2026
@bartlomieju bartlomieju merged commit 92ed54b into denoland:main Mar 4, 2026
112 checks passed
@bartlomieju bartlomieju deleted the reland_32440 branch March 4, 2026 16:51
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