Make import retry safe after ambiguous queue enqueue outcomes
维护者通常 1 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- redis, typescript
调研方向
Start by reading packages/trpc/src/routers/import.ts and apps/worker/src/jobs/import.ts, then inspect this repository's BullMQ version and its job lifecycle behavior. Add coverage for definite failures, ambiguous acknowledgements, duplicate retries, and any reconciliation path selected. Done means ambiguous outcomes cannot create concurrent jobs, definite failures remain retryable, and pending imports have documented recovery.
由索引模型根据 Issue 内容生成。
描述
Requested by @mahmoud-samy as a follow-up to PR #519.
Problem
In packages/trpc/src/routers/import.ts, importRouter.retry changes an import from failed to pending before calling the BullMQ importQueue.add. If add rejects, the route restores failed, which addresses a definite enqueue failure. If Redis persisted the job but the acknowledgement was lost, the rollback can permit a second retry and concurrent jobs for the same import ID. Concurrent jobs can interfere with staging cleanup by import ID in apps/worker/src/jobs/import.ts. A pending import with no live job may also need recovery.
Proposed work
- Investigate this repository's BullMQ version and verify duplicate-job behavior for a deterministic
jobIdkeyed on the import ID. Account for job lifecycle and later retries so valid retries remain possible. - Make retry enqueue idempotent across ambiguous acknowledgements. Do not reset an import to
failedwhen a job might already have been persisted without confirming the outcome. - Assess whether a reconciliation process is necessary for
pendingimports that lack a live job. Implement one if needed, with a safe way to distinguish live, completed, and missing jobs. - Add tests for definite enqueue failures, ambiguous enqueue outcomes, duplicate retries, and reconciliation if implemented.
Acceptance criteria
- An ambiguous acknowledgement cannot cause two active import jobs for the same import ID.
- A definite enqueue failure remains retryable.
- Pending imports without a live job have a documented recovery path.
- Tests cover the selected recovery and idempotency behavior.
Related PR: https://github.com/Openpanel-dev/openpanel/pull/519
Original review comment: https://github.com/Openpanel-dev/openpanel/pull/519#discussion_r4116862559
- 主要语言
- TypeScript
- 星标
- 7.1k
- 派生
- 510
- 平均合并
- 5 天 13 小时
- 30 天内合并 PR
- 6
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Openpanel-dev/openpanel 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
Openpanel-dev/openpanel#532 ·
维护者通常 1 天内回复
-
Period comparison badge shows wrong percentage for decreases (100 → 50 shows ↓100%)可能已有人在做 @sarmah-rup 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
Openpanel-dev/openpanel#526 ·
维护者通常 1 天内回复
-
Self-hosted missing op1-replay.js可能已有人在做 @houstona 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
Openpanel-dev/openpanel#512 · 1 条评论 ·
维护者通常 1 天内回复
-
login page needs refinement可能已有人在做 @anandghegde 于 25 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
Openpanel-dev/openpanel#495 ·
维护者通常 1 天内回复
-
Session replay: early chunks saved under the wrong session可能已有人在做 @rjocoleman 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
Openpanel-dev/openpanel#537 ·
维护者通常 1 天内回复
查看 Openpanel-dev/openpanel 的全部 Issue
相似的 Issue
-
[Docs] README: FAQ setup command, IDA in the intro, Node badge可能已有人在做 @akram1089 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked files未关闭
难度 2/5 1-3 小时 新手友好度 70/100
maniator/verticopolis#880 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 62/100
siyuan-note/siyuan#20353 ·
维护者通常 1 天内回复
-
afk-ok area:data-quality importer size:S
难度 2/5 1-3 小时 新手友好度 82/100
enorm-labs/event-junkie#3027 ·
维护者通常 1 天内回复