Skip to content

docs: document unsupported async context - #127

Merged
ronag merged 3 commits into
nxtedition:masterfrom
ronag:codex/upstream-5982-pool-async-context
Oct 9, 2026
Merged

ronag merged 3 commits into
nxtedition:masterfrom
ronag:codex/upstream-5982-pool-async-context

Conversation

@ronag

@ronag ronag commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

  • remove the queued-request AsyncResource implementation and regression test previously added on this branch
  • document that this fork does not support async-context propagation
  • direct callers to carry request-scoped state explicitly outside the transport

The net code diff against master is empty; this PR now adds documentation only.

Context

nodejs/undici#5982 preserves AsyncLocalStorage state for queued requests by adding node:async_hooks integration. This fork intentionally does not support async context, AsyncResource, AsyncLocalStorage, or other async_hooks behavior, so that upstream change is not being adopted.

A source audit of nxtedition/undici and nxtedition/nxt-undici, including the scheduler and trace dependencies used by nxt-undici, found no existing runtime use to remove outside the implementation previously introduced by this PR.

Validation

  • unit suite: 790 passed, 2 skipped
  • node-test suite: 156 passed
  • TypeScript declarations: passed
  • ESLint: passed
  • git diff --check: passed

Validated with Node.js 26.7.0 on commit 8e187cc1ebc5ca52b8f5bcb6101929e7f2e842ea.

@ronag
ronag requested a balanced review from Copilot October 9, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused implementation correctly addresses queued dispatch context and includes appropriate regression coverage.

0 open findings

What changed in this PR

Preserves caller AsyncLocalStorage context when saturated pools dispatch queued requests.

Changes:

  • Wraps queued requests in an AsyncResource.
  • Adds regression coverage using a custom pool client factory.
File Description
lib/​dispatcher/​pool-base.js Restores captured async context during queued dispatch.
test/​pool-async-context.js Verifies each queued request retains its caller context.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ronag ronag changed the title fix(pool): preserve queued request async context docs: document unsupported async context Oct 9, 2026
@ronag ronag added the documentation Improvements or additions to documentation label Oct 9, 2026
@ronag
ronag requested a balanced review from Copilot October 9, 2026 08:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation accurately reflects the package metadata and implementation.

0 open findings

🧠 Review effort: Balanced

@ronag
ronag marked this pull request as ready for review October 9, 2026 08:48
@ronag
ronag merged commit 8c1718e into nxtedition:master Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants