Open mexisme opened 9 years ago
@mexisme I see what you're saying with the conflation bit there. What it should probably do is pass the newly-minted Connection into the work_one_job
method (which accepts an optional Connection instance). The Worker doesn't seem to have/use a @connection
instance var.
@nesquena Memoizing the connection as a static/class variable seems to be causing several problems. What do you think about moving it strictly to an instance variable? Then no more problems like this.
@contentfree :+1: makes sense, thanks for tracking this down
Thanks, @contentfree, that looks like a smarter way forward.
When using the ::Forking worker, I'm seeing errors like the below when
beanstalkd
is stopped or dies (e.g. server restart). The worker fails over and over, and never makes a fresh connection.I have a suspicion it has something to do with conflation between https://github.com/nesquena/backburner/blob/master/lib/backburner/worker.rb#L58 where you're using a class var (
@connection
) but in https://github.com/nesquena/backburner/blob/master/lib/backburner/workers/forking.rb#L32 you appear to be trying to override an instance var (also@connection
) and yet https://github.com/nesquena/backburner/blob/master/lib/backburner/worker.rb#L126 uses the aboveself.connection
class method (and class var).Does this mean that all the forked children are trying to reuse the parent's
@connection
and it's no-longer valid, because the associatedbeanstalkd
has gone/restarted?It's possible this may be related to #61?
Thanks.