Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Canceled and/or removed campaigns are not stopped #1010

Closed
kbzowski opened this issue Nov 4, 2022 · 5 comments
Closed

Canceled and/or removed campaigns are not stopped #1010

kbzowski opened this issue Nov 4, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@kbzowski
Copy link

kbzowski commented Nov 4, 2022

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 kbzowski added the bug Something isn't working label Nov 4, 2022
@knadh knadh added question Further information is requested and removed bug Something isn't working labels Nov 6, 2022
@knadh
Copy link
Owner

knadh commented Nov 6, 2022

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!

@kbzowski
Copy link
Author

kbzowski commented Nov 6, 2022

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

@knadh knadh added the enhancement New feature or request label Nov 6, 2022
@knadh knadh self-assigned this Nov 6, 2022
@knadh knadh removed the question Further information is requested label Nov 6, 2022
@knadh
Copy link
Owner

knadh commented Nov 6, 2022

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
Copy link
Owner

knadh commented Aug 6, 2023

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
Copy link
Owner

knadh commented Dec 23, 2023

This is now being tested and almost ready to merge: #1636 -- It involved fully refactoring and changing the architecture of concurrent message handling in the core.

knadh added a commit that referenced this issue Dec 23, 2023
- Sent count is no longer the batch size fetched from the DB but is
  the actual count of messages sent.
- Pausing and resuming now accurately tracks the last subscriber that
  was processed and resumes from there.
- Fix multiple concurrent campaigns blocking.

Closes #1616. Closes #905. Closes #1496. Closes #1250. Closes #1010.
@knadh knadh closed this as completed Dec 30, 2023
knadh added a commit that referenced this issue Jan 4, 2024
- Sent count is no longer the batch size fetched from the DB but is
  the actual count of messages sent.
- Pausing and resuming now accurately tracks the last subscriber that
  was processed and resumes from there.
- Fix multiple concurrent campaigns blocking.

Closes #1616. Closes #905. Closes #1496. Closes #1250. Closes #1010.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants