Open rgaufman opened 7 months ago
That's strange! I'm having trouble reproducing it. If I go to that line in Rails where the exception is raised, it appears like the logger
is nil
:
The BroadcastLogger was introduced in Rails v7.1, and GoodJob does hook into it:
Just going logically, I will hypothesize that for some reason GoodJob.logger
or Rails.logger
is nil
. Does that seem like something that's configured in your application?
I have this config for good_job, the rest is the default. The only change from not working to working is updating to Rails 7.1:
config.good_job = {
preserve_job_records: true,
cleanup_discarded_jobs: true,
cleanup_interval_seconds: 60*60,
cleanup_preserved_jobs_before_seconds_ago: 60*60*8,
retry_on_unhandled_error: false,
on_thread_error: ->(exception) { Airbrake.notify(exception) },
execution_mode: :async,
queues: goodjob_queues,
max_threads: goodjob_max_threads, # WARNING: Doesn't actually enforce max_threads!
max_cache: 5_000, # Number of jobs to keep in memory, 10k = ~20MB
poll_interval: 1,
shutdown_timeout: 30,
enable_cron: true,
logger: Rails.logger
}
Could you try removing the logger: Rails.logger
line. That should be duplicative of the default (and maybe the problem).
You're right, removing that fixed the issue, thank you!
Yay! I'm glad removing that line fixed it for you.
I'm going to reopen this because I would like to try to reproduce that and see if I can have it not break because you might not be the only person doing that.
When I run:
On Rails 7.1.3 I get this exception:
This works fine if I downgrade back to Rails 7.0.8.
Any ideas?