bug: retry.fetch ignores the caller's abort signal and retries aborted requests
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #5127 来自 @umeraamir69 —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
从packages/trigger-sdk/src/v3/retry.ts开始,结合现有的重试测试阅读retryFetch。重现 issue 中的三种中止情况:已中止的init.signal、已中止的Request信号,以及已经处于中止状态的信号。完成标准是每种情况都会以AbortError拒绝,且不会发送重试;issue 说测试已准备好,但没有指出测试文件。
由索引模型根据 Issue 内容生成。
描述
Provide environment information
@trigger.dev/sdk 4.8.4 (main at 1fec779), Node 24.4.1, macOS.
Describe the bug
retry.fetch doesn't stop when the caller aborts, unlike fetch:
- Aborting
init.signalmid-request is retried as a timeout.retryFetchcan't tell the caller'sAbortErrorfrom its owntimeoutInMs, so it waits out the backoff and sends the request again, and the resend can't be aborted. - The signal of a
Requestinput is ignored.retryFetchonly listens toinit.signal. - A signal that is already aborted still sends the request, because its
abortevent never fires.
All three are in retryFetch in packages/trigger-sdk/src/v3/retry.ts.
Reproduction repo
N/A
To reproduce
Inside a task, against an endpoint that takes about 500ms to respond:
const a = new AbortController();
setTimeout(() => a.abort(), 100);
await retry.fetch(url, { signal: a.signal }); // resolves 200 after resending
const b = new AbortController();
setTimeout(() => b.abort(), 100);
await retry.fetch(new Request(url, { signal: b.signal })); // resolves 200
await retry.fetch(url, { signal: AbortSignal.abort() }); // sends the request, resolves 200
fetch rejects with AbortError in all three cases.
Suggested fix
Use init.signal, falling back to the Request's signal, link it to every attempt (including when it is already aborted), and don't retry an abort that came from it. I have this ready with tests.
Additional information
Found while working on #2490.
- 主要语言
- TypeScript
- 星标
- 16.5k
- 派生
- 1.5k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 17
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
triggerdotdev/trigger.dev 的其他 Issue
-
bug: Chat transport crashes on Safari < 17.4: AbortSignal.any is not a function可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
triggerdotdev/trigger.dev#5098 · 2 条评论 ·
维护者通常 1 天内回复
-
bug: Side menu items lose their active state on detail pages可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
triggerdotdev/trigger.dev#5088 ·
维护者通常 1 天内回复
-
bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installed可能重新可做 @itsfaryal 于 17 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
triggerdotdev/trigger.dev#5083 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
triggerdotdev/trigger.dev#5072 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
triggerdotdev/trigger.dev#5067 · 1 条评论 ·
维护者通常 1 天内回复
查看 triggerdotdev/trigger.dev 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug platform-android
难度 2/5 1-3 小时 新手友好度 68/100
Termix-SSH/Mobile#146 · 1 条评论 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
devswha/herdr-web-ui#3875 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
-
area: runtime chore cli consistency dependencies developer-experience difficulty: easy discovery documentation enhancement good first issue help wanted hygiene json-output packaging priority: P3 tests version
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复