Skip to content

fix(command-queue): Improve command queueing mechanism - #440

Merged
MarekSuchanek merged 1 commit into
developfrom
fix/command-queueing
Aug 20, 2026
Merged

fix(command-queue): Improve command queueing mechanism#440
MarekSuchanek merged 1 commit into
developfrom
fix/command-queueing

Conversation

@MarekSuchanek

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-timeout with an in-process timeout approach and adds psycopg[binary].
  • Fixes PersistentCommand.created_by conversion so NULL stays None (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.

Comment thread packages/dsw-database/dsw/database/model.py Outdated
Comment thread packages/dsw-command-queue/dsw/command_queue/command_queue.py
Comment thread packages/dsw-command-queue/dsw/command_queue/command_queue.py Outdated
Comment thread packages/dsw-command-queue/dsw/command_queue/command_queue.py Outdated
@MarekSuchanek
MarekSuchanek merged commit e9fccdd into develop Aug 20, 2026
36 checks passed
@MarekSuchanek
MarekSuchanek deleted the fix/command-queueing branch August 20, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants