Make import retry safe after ambiguous queue enqueue outcomes
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #530 by @Tyagiquamar — closed without merging
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- redis, typescript
- Domain
- backend, distributed-systems
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 7.3k
- Forks
- 552
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 18
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Openpanel-dev/openpanel
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Openpanel-dev/openpanel#694 ·
Maintainers usually reply within 1 day
-
Free trial banner overlaps the AI Chat sidebarPossibly taken @VasuS609 claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Openpanel-dev/openpanel#690 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Openpanel-dev/openpanel#653 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Openpanel-dev/openpanel#610 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
Openpanel-dev/openpanel#682 ·
Maintainers usually reply within 1 day
All issues in Openpanel-dev/openpanel
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nicobailon/pi-subagents#3425 ·
Maintainers usually reply within 1 day
-
area-a2a bug port python
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
strands-agents/harness-sdk#6697 · 1 comment ·
Maintainers usually reply within 1 day
-
api technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
opencollective/opencollective#9235 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
openwatersio/slackwater#603 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day