-
Notifications
You must be signed in to change notification settings - Fork 954
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
Delayed methods with kwargs not working using ruby 3.0.0 #1134
Comments
Also encountering this issue, a backtrace is provided. Looks like #1130 has some progress on this already
|
Yes, with #1130 it seems to work. |
Waiting on this, as well! |
@albus522 it looks like you're one of the primary caretakers of this gem. There are a couple of proposed PRs that would supposedly make DelayedJob compatible with Ruby 3. Any chance we can get your involvement to help move forward with at least one of the proposed solutions? |
Hey @albus522! So sorry to bother you again. Any chance we could get your eyes on this? |
The mail jobs are affected by a ruby 3 compatibility issue in the DelayedJob gem: collectiveidea/delayed_job#1134
The delayed_job gem does not currently perserve keyword arguments properly leading to errors when running under ruby 3 and try to run a job that requires them. This affects our deferred mail deliveries so we monkey patch the mail delivery job to unpack the hash from the normal arguments and use it to provide the expected keyword arguments. collectiveidea/delayed_job#1134
The delayed_job gem does not currently perserve keyword arguments properly leading to errors when running under ruby 3 and try to run a job that requires them. This affects our deferred mail deliveries so we monkey patch the mail delivery job to unpack the hash from the normal arguments and use it to provide the expected keyword arguments. collectiveidea/delayed_job#1134
Ruby 2.7 is EOL on March 31st and this is still broken which is a shame. It has been an obstacle in upgrading services to ruby 3x. There are a number of PRs addressing this issue, which can be leveraged but it would be nice to have an officially supported fix in. |
Keyword arguments have a lot of hidden complexity to implement for a background task which is why background job libraries are opting not to support them. This is not a ruby 2.7 compatibility thing. It is a complex ongoing support thing. I don't expect Delayed Job will be adding support for this. |
ok good to know. thanks! |
Well, this is a sad discovery during an upgrade process. I'd like to learn more about other the other bg job libraries that are having issues or the specific issues in delayed_job. Having a bg job library not support kwargs isn't stellar for developer experience. Also, it seems Betterment's delayed gem has taken up the torch and supports kwargs for those who don't want to revert to positional args. In any case, much gratitude to the delayed_job contribs, we've relied on this library for a long time. Thank you :) |
- this was deprecated in Ruby 2.7 and breaks in Ruby 3.0, See collectiveidea/delayed_job#1134 https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
I noticed this was closed as completed but I'm still experiencing the issue when upgrading a codebase from Ruby 2.7 to Ruby 3.1 with delayed_job's |
It has never been fixed @brettchalupa |
I recently upgraded our rails app to 6.1 running on ruby 3.0.0. I have now several parts of my code failing when calling methods with keyword arguments (or named parameters) in conjunction with delay. I can reproduce the issue in the rails console:
I think this has something to do with the separation of args and kwargs introduced in ruby 2.7. Does delayed_job support ruby 3 and I am missing something? Or is this a compatibility issue?
Rails Version: 6.1.0
Ruby Version: 3.0.0
Delayed Job Version:
delayed_job_active_record (4.1.5)
delayed_job (4.1.9)
The text was updated successfully, but these errors were encountered: