Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Infer interruption handler from a job's queue adapter #367
Infer interruption handler from a job's queue adapter #367
Changes from all commits
e07ddc0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should register a dummy handler, not raise.
Otherwise, this results in an exception for any queue adapter that isn't recognized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was by design, see the discussion above regarding a Fallback adapter I originally included but then removed.
The problem with the old behaviour is that (depending on the queue adapter) it can lead to lost jobs if the process cannot re-enqueue jobs and shutdown gracefully, since it would never interrupt the job. This is no longer silently allowed to happen. If you need this to work as it used to, you can register your own interruption adapter with:
JobIteration::Integrations.register("queue_adapter_name", -> { false })
It is a breaking change that should be called out explicitly in the changelog, I opened for that: #425
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this breaks the users (our team uses qless (yes, I know, it's unmaintained, we're moving away from it))
How about this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR will be part of a new major release to my understanding, because there are other breaking changes: if you had written your own interruption adapter for active_qless you can't set it via
JobIteration.interruption_adapter
anymore. Makes sense to break related things together :)Is there a reason you can't register your own adapter like in my previous message if you need to be on latest main? Alternatively, cut a
1-0-stable
branch starting from 7e6c385 and cherry-pick non-breaking changes from main and cut a new point release if for some reason you absolutely have to use Iteration from Rubygems?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pretty much what I ended up doing, yes, but in general, I think it'd be good to keep a non-breaking 1.x.
Merging to
main
without already having a plan to make a new major release means that the releaser will have a tougher challenge on their hands, having to disentangle which changes are breaking and which aren't.Perhaps we're already at a point where we should be starting a 1.x branch?
I assume that after we release 2.x, we'll likely want to backport some fixes to 1.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the breaking change is fairly minimal (primarily replacing
JobIteration.interruption_adapter
withJobIteration::Integrations.register
), I'm not sure it's worth the effort to maintain a separate 1.x branch and backport fixes to there. I was planning to release 2.0 pretty soon, without cutting another minor version in-between.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then 👍🏼