Skip to content

🐛 ZMQ broker: send immediate task acknowledgment#7356

Merged
agoscinski merged 1 commit into
aiidateam:mainfrom
agoscinski:fix/zmq-immediate-ack
Apr 30, 2026
Merged

🐛 ZMQ broker: send immediate task acknowledgment#7356
agoscinski merged 1 commit into
aiidateam:mainfrom
agoscinski:fix/zmq-immediate-ack

Conversation

@agoscinski
Copy link
Copy Markdown
Collaborator

This is super hard to understand because it is going through plumpy and kiwipy logic. Basically we immediately send an ACK on submission of a task to not let the client wait for the response (so you can spam responses). I thought I implemented it the way RMQ does it but apparently not. Because I assigned the broker to the daemon lifetime (and thus worker lifetime) this got unnoticed.


When a task is received, the broker now sends an immediate TASK_RESPONSE back to the sender as soon as the task is persisted to the queue on disk. This matches RabbitMQ's publisher-confirm semantics: the caller's Future resolves without waiting for a worker to process the task.

Previously, the sender's Future would only resolve when a worker sent its result back, causing timeouts when no workers were connected (e.g. during verdi process repair with the daemon stopped).

Update the internal architecture docs to reflect that the broker now sends an immediate TASK_RESPONSE when a task is queued (matching RabbitMQ publisher-confirm semantics), rather than forwarding the worker's result back to the sender.

When a task is received, the broker now sends an immediate
TASK_RESPONSE back to the sender as soon as the task is persisted
to the queue on disk.  This matches RabbitMQ's publisher-confirm
semantics: the caller's Future resolves without waiting for a worker
to process the task.

Previously, the sender's Future would only resolve when a worker
sent its result back, causing timeouts when no workers were connected
(e.g. during `verdi process repair` with the daemon stopped).

Update the internal architecture docs to reflect that the broker now
sends an immediate TASK_RESPONSE when a task is queued (matching
RabbitMQ publisher-confirm semantics), rather than forwarding the
worker's result back to the sender.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.26%. Comparing base (90997a3) to head (8f2ec01).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7356      +/-   ##
==========================================
- Coverage   80.26%   80.26%   -0.00%     
==========================================
  Files         577      577              
  Lines       45505    45497       -8     
==========================================
- Hits        36519    36512       -7     
+ Misses       8986     8985       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@agoscinski agoscinski marked this pull request as ready for review April 30, 2026 20:18
@agoscinski agoscinski enabled auto-merge (squash) April 30, 2026 20:24
@agoscinski agoscinski disabled auto-merge April 30, 2026 20:26
@agoscinski agoscinski merged commit 06968d4 into aiidateam:main Apr 30, 2026
19 checks passed
@agoscinski agoscinski deleted the fix/zmq-immediate-ack branch April 30, 2026 20:26
agoscinski added a commit to agoscinski/aiida-core that referenced this pull request Apr 30, 2026
When a task is received, the broker now sends an immediate
TASK_RESPONSE back to the sender as soon as the task is persisted
to the queue on disk.  This matches RabbitMQ's publisher-confirm
semantics: the caller's Future resolves without waiting for a worker
to process the task.

Previously, the sender's Future would only resolve when a worker
sent its result back, causing timeouts when no workers were connected
(e.g. during `verdi process repair` with the daemon stopped).

Update the internal architecture docs to reflect that the broker now
sends an immediate TASK_RESPONSE when a task is queued (matching
RabbitMQ publisher-confirm semantics), rather than forwarding the
worker's result back to the sender.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant