rails / solid_queue

Database-backed Active Job backend
MIT License
1.97k stars 132 forks source link

undefined method `supervisees`for nil #430

Open wdiechmann opened 6 days ago

wdiechmann commented 6 days ago

https://github.com/rails/solid_queue/blame/c521c6d47d10abeaf076a81d9af29e80eb2b11c7/lib/solid_queue/supervisor.rb#L174

probably should look something like process&.supervisees.find_by... or

if registered_process = process.supervisees.find_by(name: terminated_fork.name) rescue false
rosa commented 5 days ago

Huh, yes, but I'm curious to know when you reach this line with process being nil 🤔 In theory, this should never be executed before the supervisor has been registered. I must be missing a scenario where this might happen, but not sure what it'd be. Do you have more context about when you hit this?

wdiechmann commented 5 days ago

I got the background job to work - 99% thx to you - and then I let it rip for a few hours - and once I got back to my desk, the log told me that there where no supervisees hanging out with the nil process 😉

I'll make sure to try to sample better context when this happens again - if it does