phobos: When listeners are getting crashed, it is failing to recover by itself.
When the Kakfa server is down, the listeners are getting crashed and it is unable to recover by itself, giving me the following error…
{:message=>“Listener crashed, waiting 19.22s (undefined method
join' for nil:NilClass)", :listener_id=>"438526", :retry_count=>4, :waiting_time=>19.22, :exception_class=>"NoMethodError", :exception_message=>"undefined methodjoin’ for nil:NilClass”, :backtrace=>[“/opt/IBM/cobalt/sla.25.4/messenger/vendor/bundle/ruby/2.4.0/gems/ruby-kafka-0.7.5/lib/kafka/fetcher.rb:66:instop'", "/opt/IBM/cobalt/sla.25.4/messenger/vendor/bundle/ruby/2.4.0/gems/ruby-kafka-0.7.5/lib/kafka/consumer.rb:113:instop”
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 19 (9 by maintainers)
Hey @austinmoore!
I think you might be misreading the situation in terms of the quote you added from the ruby-kafka docs. That’s talking about creating threads within your consumer, which we don’t do (we have separate consumers per thread). It also says you shouldn’t share a Kafka client between threads, which again we don’t do.
I think probably the best solution would be to move the
@running = trueline from before the thread is initialized to after it’s initialized. That would avoid these crashes as I don’t think there are any other adverse effects.