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 issue 482 #496

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Fix issue 482 #496

merged 3 commits into from
Jan 28, 2025

Conversation

hms
Copy link
Contributor

@hms hms commented Jan 24, 2025

  • Addresses Ruby version issues.
    • Ruby 3.1.6 Thread::Queue.pop does not support a timeout option. To address this issue, given that Ruby 3.1.6 is 2 months from EOL, this PR conditionally includes either the current version of Interruptible or the original implementation of Interruptible. It's intended this part of the PR should be removed once SQ raising the min supported Ruby to >= 3.2
    • Fixes claimed_execution_test to support Ruby 3.4+ (different backtrace formatting)
    • Updates the Github actions to test a major subset of the rubies between 3.1.6 - 3.4.1.
      • Required special case handling for Ruby 3.1.6 because of a dependency issue with Zeitwerk.
  • Added error reporting in Interruptible#interruptible_sleep. In theory, this shouldn't ever be needed, but since I thought that with the original PR....
  • Addresses a silly little bug in ScheduledExecution that didn't have an effect, but it was a bug.

hms added 3 commits January 24, 2025 10:57
ScheduledExecution#dispatch_next_batch was returning either an empty
array or an integer count of the number of rows processed by the method.
The client of this method is Worker and Dispatcher #poll, and poll
requires the count of the number of rows processed.

This commit changes the returned empty array to an integer value of 0
for consistency’s sake.  It also includes small updates to the tests
for these methods.
The current Thread::Queue based Interruptible can not work with
Ruby version earlier than 3.2.  Given that SQ sets it's minimum
supported version of Ruby is derived from "full support of Rails 7.1",
this in theory mandates support for Ruby 2.7.8.  However, other
dependencies force the minimum version of Ruby to: 3.1.6

This commit adds a boot time check of the Ruby version and selects
either the current or original implementation of Interruptible.
Updates the ruby test matrix to test the
following Rubies:
* SQ minimum supported version of Ruby: 3.1.6
  - this is the terminal version of Ruby 3.1 which is due
to EOL 3/31/25
* First and last version Ruby 3.2: 3.2.0 and 3.2.4
* Every version of Ruby 3.3: 3.3.0 - 3.3.6
* Every version of Ruby 3.4: 3.4.0 - 3.4.1

Updates gemspec to handle a ruby 3.1.6 conditional zeitwerk version requirement.
Ruby 3.1.6 requires an older version of zeitwerk. This has a knockon
effect of requiring special handling in the Github Action.

Finally, updates claimed_execution_test.rb to handle Ruby-3.4.0+
@rosa rosa mentioned this pull request Jan 28, 2025
@rosa rosa merged commit 2bc05ed into rails:main Jan 28, 2025
34 checks passed
@rosa
Copy link
Member

rosa commented Jan 28, 2025

Thanks a lot @hms! 🙏

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