Issue Description
Stalwart 1.0.3 (8b32686), 3 nodes. PauseMtaQueue through one node reaches all 3. A node restarted while paused comes back unpaused and delivers, while the others stay paused.
Expected Behavior
A restarted node stays paused while the cluster is paused.
Actual Behavior
Test, 1 run: an ordinary message delivers normally. PauseMtaQueue, then 8 messages.
| Step |
Delivered of 8 |
| Paused 120 s, no restart |
0 |
| One node restarted |
8, all by that node, 2 to 3 s after the restart |
None delivered twice, none lost.
Reproduction Steps
- 3-node cluster.
x:Action/set create {"@type":"PauseMtaQueue"} on one node.
- Submit 8 messages to a remote address. Wait 120 s: none delivered.
systemctl restart stalwart on one node. All 8 delivered by that node within seconds.
Relevant Log Output
None. This isn’t an error, so there’s nothing relevant to show.
Stalwart Version
v1.x
Installation Method
Binary (Linux)
Database Backend
PostgreSQL
Blob Storage
S3-compatible
Search Engine
PostgreSQL
Directory Backend
Internal
Additional Context
is_paused starts false (smtp/src/queue/manager.rs:129).
It catches you in planned work: pause to drain the queue, restart a node twice or crash it, and it delivers while you think it’s paused.
Persisting the pause, or having a restarted node ask the cluster, would make planned work safer.
Posted here as asked on the earlier Feature Ideas topic, 2219.
Tested and written with AI help.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on
Your report matches the current behaviour. The docs don’t say whether a pause survives a restart, and I couldn’t find anything in the docs or source that persists it.
The queue management page says PauseMtaQueue and ResumeMtaQueue act on every node of the cluster. It says nothing about what happens when a node restarts. The in-memory is_paused flag in smtp/src/queue/manager.rs starts as false, as you noted. That matches what you saw: a node that restarts during a pause comes back unpaused and starts delivering.
If you plan maintenance with the pause, treat it as per-process state for now. After any node restart or crash, send PauseMtaQueue again. A node that restarted won’t know the cluster is paused until you do.
Whether a restarted node should persist the pause or ask the cluster for it is a design decision. A human will follow up on that.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
Hi,
A pause only lives in the memory of each node and is never written anywhere. A node that starts while the others are paused, after a restart or a crash, or one that has just joined the cluster, comes up with its queue running, which is what your test shows. I’m adding a note about this to the queue management page, since that page says nothing about restarts.
If you restart a node during planned work, send PauseMtaQueue again right after it comes back. That narrows the window but doesn’t close it: the queue starts about a second after startup, so messages that are already due can still leave from that node first. For maintenance where nothing may go out at all, stop the node’s delivery path itself (for example block its outbound port 25) while it restarts.
Keeping the pause across restarts, or having a starting node ask the cluster, is a fair request. Since it changes how the pause works, please keep it in your Feature Ideas topic.