Fix NoMethodError: undefined method redis' for nil:NilClass due to lack of config`#10
Open
jvortmann wants to merge 8 commits into
Open
Fix NoMethodError: undefined method redis' for nil:NilClass due to lack of config`#10jvortmann wants to merge 8 commits into
NoMethodError: undefined method redis' for nil:NilClass due to lack of config`#10jvortmann wants to merge 8 commits into
Conversation
--- Change-type: test
jvortmann
force-pushed
the
fix-nil-pointer-on-requeue
branch
from
February 29, 2024 19:26
72de968 to
12a1796
Compare
Since sidekiq/sidekiq@67daa7a4 the `UnitOfWork` changed its interface to include `config`. The `config` is not returned from the `brpop` method, and therefore creating a `UnitOfWork` with `*work` passed `config` as `nil`. This is causing `nil` pointers on requeue because the method uses `config.redis` to perform the `rpush`. This change not only fixes that as brings the latest code from `sidekiq` that also deals with some timeouts (not tested in this change). Except from the timeout part, the rest is tested here. --- Change-type: fix See-also: sidekiq/sidekiq@67daa7a4 See-also: https://github.com/sidekiq/sidekiq/blob/main/lib/sidekiq/fetch.rb#L47
This caused the connection to hang without returning any work. Letting this one for later. --- Change-type: feature
jvortmann
force-pushed
the
fix-nil-pointer-on-requeue
branch
from
February 29, 2024 19:29
12a1796 to
c9918c1
Compare
--- Change-type: fix
jvortmann
force-pushed
the
fix-nil-pointer-on-requeue
branch
from
February 29, 2024 21:44
c9918c1 to
0acf8a2
Compare
--- Change-type: feature
--- Change-type: fix
--- Change-type: feature
--- Change-type: deps
jvortmann
force-pushed
the
fix-nil-pointer-on-requeue
branch
from
March 4, 2024 16:54
0a7c45b to
8196e13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix
nilpointer when requeue a unit of workSince sidekiq/sidekiq@67daa7a4 the
UnitOfWorkchanged its interface to includeconfig. Theconfigisnot returned from the
brpopmethod, and therefore creating aUnitOfWorkwith*workpassedconfigasnil. This is causingnilpointers on requeue because the method usesconfig.redistoperform the
rpushand there is noconfig.Change-type: fix
See-also: sidekiq/sidekiq@67daa7a4
See-also: https://github.com/sidekiq/sidekiq/blob/main/lib/sidekiq/fetch.rb#L47