listmonk
listmonk copied to clipboard
Canceled and/or removed campaigns are not stopped
Version:
- listmonk: 2.2.0
- OS: Docker (listmonk/listmonk:latest)
Description of the bug and steps to reproduce: The canceled and/or deleted campaign is further sent. I don't know if this is related, but I have a very low sending limit set (1 message per minute)
A batch size worth of e-mails may be held in the in-memory queue. Even if a campaign is cancelled, this batch size is drained. With a rate as low as 1/minute, it'll take a long time to drain!
@knadh Thank you for the clarification. Correct me if I'm wrong, but isn't it confusing that pausing doesn't pause immediately? I assumed that deleting the campaign should also clear the message queue to send immediately. Especially since there could be a situation where after deleting a campaign, a new one won't start because the previous one is still running (which is no longer visible on the UI side). I noticed these situations when I tested listmonk internally (hence this window).
Yep, it's not ideal behaviour. Instant cancellation has been on the long list of to-dos for a while. Will look into this.
I've come back to this from time to time with no clear visible solutions. Have narrowed down on attaching a Go context.Context per campaign to every campaign message and using that to track cancellations/pausing/resumption. This involves major changes to how campaign messages are handled internally. Will experiment and figure out if this can be rolled out in the next version.
This is now being tested and almost ready to merge: https://github.com/knadh/listmonk/pull/1636 -- It involved fully refactoring and changing the architecture of concurrent message handling in the core.