Honor HTTP-date Retry-After values in OtlpExporter - #6864
Conversation
🦋 Changeset detectedLatest commit: be1a27d The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Reproduction test for HTTP-date Retry-After parsing: adds
OtlpExporterRetryAfterDate.test.tsthat reproduces the bug whereOtlpExporterignores HTTP-dateRetry-Aftervalues (RFC 7231), falling through to the 5-second default. The test correctly fails with the current code and would pass once the header is parsed as a date.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
| @@ -0,0 +1,49 @@ | |||
| import { assert, it } from "@effect/vitest" | |||
There was a problem hiding this comment.
Can you please merge this test file into the main one?
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Extracted
retryAfterDelayfunction that resolvesRetry-Afterheaders against the Effect clock, handling numeric seconds, HTTP-date values (RFC 7231), missing headers, and unparseable strings with the appropriate fallbacks - Made
policyclock-aware by accepting aClockparameter so that HTTP-date delays compute a relative duration rather than a static one - Added HTTP-date retry test that follows the existing three-phase pattern — verifies the initial 429 is counted, no premature retry at 5s, and the retry occurs after the full 60s delay
- Merged the reproduction test into the main
OtlpExporter.test.tsfile
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
| return Duration.millis(Math.max(timestamp - clock.currentTimeMillisUnsafe(), 1)) | ||
| } | ||
|
|
||
| const policy = (clock: Clock) => |
There was a problem hiding this comment.
Instead of threading through the clock, you can access using the reference.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Switched
retryAfterDelayto readClockfrom environment rather than threading it as a parameter —policyis back to a module-levelconst, and all branches returnEffect.succeed(...). The HTTP-date branch usesEffect.map(Clock, ...)to compute the delay relative to the runtime clock.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Summary
Retry-AftervaluesVerification
Closes EFF-303