Skip to content

Conversation

jvortmann
Copy link

@jvortmann jvortmann commented Feb 29, 2024

Fix nil pointer when requeue a unit of work

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 and there is no config.


Change-type: fix
See-also: sidekiq/sidekiq@67daa7a4
See-also: https://github.com/sidekiq/sidekiq/blob/main/lib/sidekiq/fetch.rb#L47

@jvortmann jvortmann force-pushed the fix-nil-pointer-on-requeue branch from 72de968 to 12a1796 Compare February 29, 2024 19:26
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 jvortmann force-pushed the fix-nil-pointer-on-requeue branch from 12a1796 to c9918c1 Compare February 29, 2024 19:29
---

Change-type: fix
@jvortmann jvortmann force-pushed the fix-nil-pointer-on-requeue branch from c9918c1 to 0acf8a2 Compare February 29, 2024 21:44
@jvortmann jvortmann force-pushed the fix-nil-pointer-on-requeue branch from 0a7c45b to 8196e13 Compare March 4, 2024 16:54
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.

1 participant