Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Make import retry safe after ambiguous queue enqueue outcomes

未关闭
#523 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Tyagiquamar 已经在做这个了。

开始于 2026年10月2日。

  • #530 来自 @Tyagiquamar —— 未关闭

评估

难度
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 jobId keyed 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 failed when a job might already have been persisted without confirming the outcome.
  • Assess whether a reconciliation process is necessary for pending imports 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 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Openpanel-dev/openpanel 的其他 Issue

查看 Openpanel-dev/openpanel 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。