-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Labels
Description
I'm encountering an intermittent NameError: uninitialized constant when using namespaced Sidekiq job classes (e.g. DocumentAI::ProcessFileJob) with sidekiq-throttled. This happens even though the job classes are correctly defined, autoloaded by Zeitwerk, and run fine under normal conditions.
My job class is:
class DocumentAI::ProcessFileJob
include Sidekiq::Job
include Sidekiq::Throttled::Job
sidekiq_throttle(
concurrency: {
limit: 2,
key_suffix: ->(token, *rest) { token }
}
)
endError in my Rails log:
INFO 2025-06-13T06:24:37.788Z pid=9 tid=ktf9: /gems/ruby/3.2.0/gems/sidekiq-throttled-2.0.0/lib/sidekiq/throttled.rb:102:in `const_get': uninitialized constant DocumentAI (NameError)
be-1 |
be-1 | job_class = Object.const_get(message.fetch("wrapped") { message.fetch("class") { return false } })This happens sporadically, especially after the worker boots, but not always reproducible — sometimes jobs run fine, sometimes this error pops up.
Reactions are currently unavailable