Repository navigation
Clarify queue timeouts and application cleanup - #1312
Conversation
Explain why queue timeouts do not cancel handlers or clean up application resources, and how detached parallel workers affect ordering and retries. Add a bounded recursive loader example sharing one application budget across document and context fetches. Correct the PostgreSQL option docs and regression-test comment without changing runtime behavior. Fixes fedify-dev#1310 Changelog: none Assisted-by: OpenCode:deepseek-flash Assisted-by: Codex:gpt-6.1-sol Assisted-by: Claude Code:claude-fable-5-1
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔇 Additional comments: 5
packages/postgres/src/mq.ts: 1
106-113: LGTM!packages/postgres/src/mq.test.ts: 1
1337-1339: LGTM!docs/manual/mq.md: 1
1043-1043: 📐 Maintainability & Code QualityKeep the heading as written.
The file already uses ATX style for third-level headings, including nearby headings. The comment does not establish an applicable
MD003rule or a lint failure. Converting this heading would be an unsupported style change.docs/manual/tasks.md: 1
187-194: LGTM!docs/manual/mq.md-1062-1063: 1
1062-1063: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Wrap the long lines in the example code.
Lines 1062 and 1063 are much longer than the surrounding code. The code block is exempt from Hongdown prose wrapping. Long lines are still hard to read in the rendered docs, because code blocks scroll horizontally. Break them across lines.
Proposed change
- const timer = setTimeout(() => budget.abort(new Error("Work budget expired")), 30_000); - const withBudget = (loader: DocumentLoader): DocumentLoader => async (url, options) => { + const timer = setTimeout( + () => budget.abort(new Error("Work budget expired")), + 30_000, + ); + const withBudget = (loader: DocumentLoader): DocumentLoader => + async (url, options) => {
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
547503b6-9918-4595-a997-f702b23988fb
📒 Files selected for processing: 4
docs/manual/mq.mddocs/manual/tasks.mdpackages/postgres/src/mq.test.tspackages/postgres/src/mq.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
handlerTimeoutstops PostgreSQL/MySQL queues from waiting but leaves handlers running. Application transactions and late writes can therefore outlive the queue's ordering lock.The guide separates queue-owned cleanup from application-owned resources and shows one cancellation budget shared across recursive document and context loads. It also explains how detached parallel workers affect backend timeouts, retries, and ordering, so readers do not mistake callback completion for completed work.
Fixes #1310.