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

Unblock rufus-scheduler upgrade by fixing shutdown #736

Merged
merged 2 commits into from
Mar 26, 2022

Conversation

carsonreinke
Copy link
Contributor

Updates #723

Looking into this more, it appears the use of calling #join on the scheduler is not needed when calling #shutdown(:wait) since that will block the current thread until shutdown. The reason this worked before looks like simply rufus-scheduler unexpectedly supported this and it appears completely accidental. Looking into the differences it looks the reason why is that the old rufus-scheduler method allowed calls on #join after shutdown because the @thread variable is never reset after shutdown (see https://github.com/jmettraux/rufus-scheduler/blob/v3.2.0/lib/rufus/scheduler.rb#L171). After changes in v3.6.0, this is no longer allowed since it is using a queue system instead.

@carsonreinke carsonreinke changed the title Rufus scheduler unblock Unblock rufus-scheduler upgrade by fixing shutdown Nov 22, 2021
@carsonreinke carsonreinke marked this pull request as ready for review November 22, 2021 00:12
@TomA-R
Copy link

TomA-R commented Nov 30, 2021

Thanks @carsonreinke! This would be really good to get merged, thanks in advance 🙇 cc @iloveitaly

@fagiani
Copy link

fagiani commented Mar 19, 2022

@iloveitaly I have confirmed those changes get tests passing and allowing dependencies to get upgraded. Is there anything else pending to get this PR merged? Keep Rocking!

@iloveitaly
Copy link
Contributor

@fagiani I've upgraded CI to do a matrix test across a bunch of rufus & resque versions. Can you rebase on master to fix merge conflicts and ensure this is tested across different configurations?

Copy link

@fagiani fagiani left a comment

Choose a reason for hiding this comment

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

This needs to be rebased to master in order to merge conflicts and pass on CI workflows. Would you mind allowing changes to the PR and allowing @fagiani as a contributor?

@fagiani
Copy link

fagiani commented Mar 22, 2022

@iloveitaly I've tried to set myself as a reviewer in order to check if I could push the rebased branch but as far as I was able to find, in order to achieve that the PR must allow changes from maintainers and I need to become a contributor somehow. In respect to @carsonreinke's work I did not recreate a new PR. Please let me know how would you like to proceed.

@carsonreinke carsonreinke force-pushed the rufus-scheduler-unblock branch from 68732ae to 3b27fe3 Compare March 24, 2022 19:38
@carsonreinke
Copy link
Contributor Author

@iloveitaly @fagiani I pushed up a rebase, let me know if you need anything else.

@@ -377,7 +377,6 @@ def handle_signals_with_operation

def stop_rufus_scheduler
rufus_scheduler.shutdown(:wait)
rufus_scheduler.join
Copy link

Choose a reason for hiding this comment

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

Looking at the CI tests, looks like the only version failing is 3.6.

I'd suggest something like:

rufus_scheduler.join if Gem.loaded_specs["rufus_scheduler"].version.to_s.starts_with?("3.6")

I'd guess this change would potentially fix the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fagiani ugh, looks like a flake, rebuilt and it passed. Ran it locally without failure. I don't believe that failure would even be related to this change though.

Copy link

Choose a reason for hiding this comment

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

great @carsonreinke !

@iloveitaly when is the next release including this PR planned?

Keep Rocking!

@iloveitaly iloveitaly merged commit fa3e26b into resque:master Mar 26, 2022
@TomA-R
Copy link

TomA-R commented May 12, 2022

Thanks for merging this, @iloveitaly! Any chance we could get this released? Thanks in advance

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.

4 participants