listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Canceled and/or removed campaigns are not stopped

Open kbzowski opened this issue 3 years ago • 3 comments
trafficstars

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)

kbzowski avatar Nov 04 '22 14:11 kbzowski

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 avatar Nov 06 '22 06:11 knadh

@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).

kbzowski avatar Nov 06 '22 09:11 kbzowski

Yep, it's not ideal behaviour. Instant cancellation has been on the long list of to-dos for a while. Will look into this.

knadh avatar Nov 06 '22 18:11 knadh

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.

knadh avatar Aug 06 '23 06:08 knadh

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.

knadh avatar Dec 23 '23 05:12 knadh