Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix iterable jobs cancellation #6589

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

fatkodima
Copy link
Member

Currently, cancelling an iterable job works only when the job was interrupted and it starts again. In this case the cancellation flag is checked correctly.

When the job is running, the flag's value is checked incorrectly, because it is set to a timestamp in the codebase.

p.hsetnx(key, "cancelled", Time.now.to_i)

I haven't added tests, because looks like it will be particularly hard to test this case (the test case should at least use a new interrupting thread).

@mperham mperham merged commit 9a3ec47 into sidekiq:main Jan 25, 2025
10 checks passed
@mperham
Copy link
Collaborator

mperham commented Jan 25, 2025

Can you cherry pick that onto 7-x too? Don't worry about a PR.

fatkodima added a commit that referenced this pull request Jan 25, 2025
@fatkodima fatkodima deleted the fix-iterable-jobs-cancellation branch January 25, 2025 16:27
@fatkodima
Copy link
Member Author

Cherry-picked into 7-x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants