Skip to content

Conversation

marcoserrato
Copy link
Contributor

@marcoserrato marcoserrato commented Sep 25, 2025

Addressed this issue.

Re-release #39 under a new major version

prime @jturkel @erikkessler1

@marcoserrato marcoserrato requested a review from a team as a code owner September 25, 2025 16:44
Comment on lines +6 to +7
Delayed::Job sets this option to true by default, you will need to configure it to false
in order to include this library.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include this in the README too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added! thoughts?

Base automatically changed from ms/revert-version-13 to master September 25, 2025 18:57
In order to allow individual jobs in the JobGroup to perform cleanup activities upon 
job failure, a JobGroups on cancellation job must be enqueued in the after failure 
delayed job lifecycle hook. If both were to be performed in the same hook, the job's
failure hook and the on cancellation job may run at the same time since hook execution 
order is never guaranteed. This is particular important if the on cancellation job 
depends on state set in the failure hook of an individual job.

This also forces the Delayed::Worker.destroy_failed_jobs to be set to
false in order to prevent a race condition where a JobGroup could be
completed (instead of cancelled) if a successful job occurs at the same
time as a failing job.
@marcoserrato marcoserrato force-pushed the ms/move-on-cancellation-failure-hook branch from fad8207 to 77f8014 Compare September 25, 2025 19:19
$ rails generate delayed_job_groups_plugin:install
$ rake db:migrate

## Upgrading from 0.14.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true for the initial installation too, right? If you're up for it, maybe it would be nice to include in the delayed_job_groups_plugin:install generator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the generator to set the option, let me know what you think! Had to find a work around for being able to run the generator with the gem included, since generators run after railties run... We can assume the library hasn't been fully setup until the table is present, so we can skip raising the error in that case.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

$ rails generate delayed_job_groups_plugin:install
$ rake db:migrate

## Upgrading from 0.14.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@marcoserrato marcoserrato merged commit 0a648a1 into master Oct 8, 2025
3 checks passed
@marcoserrato marcoserrato deleted the ms/move-on-cancellation-failure-hook branch October 8, 2025 11:38
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.

3 participants