mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-06 02:28:56 +00:00
I think we've gone back and forth on this a couple of times. The motivation for this commit is that we've been troubleshooting an issue that seems to be triggered by bouncing all the mail. The symptom is that the system becomes unresponsive after triggering the bounce. Here in the context of `bounce_all`, the queue lock is held so that we can capture the messages, but then we serially remove them from the spool, so that we can report the total number back to the originating HTTP request. For a large queue size that presents a big point of contention for other tasks or requests that may need to operate on the queue. This commit moves that spool removal into another task so that that task can run asynchronously and independently from the bounce HTTP request. The consequence of this is that the numbers reported by the bounce request will likely be lower than the final count. The `bounce-list` kcli command can be used to check up on those numbers.