fix(retry): snapshot trace metadata - #239
Merged
Merged
Conversation
…adata-snapshot * origin/main: fix(verify): snapshot trace metadata fix(body-factory): support on/off signals fix(body-factory): abort while queued
There was a problem hiding this comment.
Pull request overview
This PR ensures undici:retry trace documents remain correlated with the immutable undici:request start/end trace identity even when a custom retry strategy mutates the live request options before calling defaultRetry().
Changes:
- Snapshot retry trace identity (
id/method/boundedurl) and trace writer once for use by retry trace emission. - Update retry trace emission to use the captured snapshot rather than live (mutable) dispatch options.
- Add a regression test that mutates
id,method,origin, andpathinside a customretry()callback and asserts trace correlation remains stable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/trace-retry-metadata-snapshot.js | Adds regression coverage ensuring retry callback mutations do not break request/retry trace correlation. |
| lib/interceptor/response-retry.js | Captures trace identity/writer and emits undici:retry docs from the snapshot to preserve correlation under mutated opts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…adata-snapshot * origin/main: docs(dns): describe policy-scoped deduplication test(dns): yield during trace polling fix(url): validate object authorities fix(url): reject malformed object protocols perf(dns): streamline TTL policy keys refactor(pressure): rely on Node timer API fix(dns): scope cache by TTL policy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
id/method/boundedurlon the first retry decisionundici:retrydocs to mutated options before it invokesdefaultRetry()undici:requeststart/end pair without adding trace work to successful retry-eligible requestsTests
id,method,origin, andpathbefore callingdefaultRetry()opts.tracegit diff --checkpass