fix(command-queue): Improve command queueing mechanism - #440
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the dsw-command-queue processing loop to improve correctness and operational behavior under load/failures (locking, retry/backoff, notification handling), and includes a small dsw-database model fix plus dependency updates needed for psycopg-based notification waiting.
Changes:
- Refactors command selection/backoff and adds explicit row-lock + savepoint handling to avoid concurrent processing and unintended commits on failure.
- Reworks queue listening/notification waiting and iteration-level retry behavior; replaces
func-timeoutwith an in-process timeout approach and addspsycopg[binary]. - Fixes
PersistentCommand.created_byconversion soNULLstaysNone(instead of becoming'None'), and updates changelogs/spell dictionary accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates locked dependencies (removes func-timeout, adds psycopg[binary]). |
| packages/dsw-database/dsw/database/model.py | Adjusts created_by mapping for PersistentCommand to preserve None. |
| packages/dsw-database/CHANGELOG.md | Documents the created_by mapping fix. |
| packages/dsw-command-queue/pyproject.toml | Replaces func-timeout with psycopg[binary]>=3.2 dependency. |
| packages/dsw-command-queue/dsw/command_queue/query.py | Updates command selection query and adds lock/savepoint queries. |
| packages/dsw-command-queue/dsw/command_queue/command_queue.py | Major refactor: listening lifecycle, notification receiving, locking/savepoints, retry behavior, timeout mechanism. |
| packages/dsw-command-queue/dsw/command_queue/init.py | Exposes newly introduced public exception types. |
| packages/dsw-command-queue/CHANGELOG.md | Documents queue correctness/behavior changes and dependency replacement. |
| .cspell/dictionary.txt | Adds timestamptz to spelling dictionary. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MarekSuchanek
force-pushed
the
fix/command-queueing
branch
from
August 20, 2026 08:17
b9485de to
dd4914a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.