njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
538 stars 135 forks source link

Random SIGTERM & SIGHUP exceptions in infinite loop #119

Closed prasadpilla closed 4 years ago

prasadpilla commented 4 years ago

Every few hours/tens of mins or so I am seeing SIGTERM & SIGHUP exceptions popping up from get_packet method.

Here is the stack trace, can you please look into this? I dug into the code, it just fails in the queue pop method, so i couldn't figure out what's wrong there.

lib/mqtt/client.rb:436 pop lib/mqtt/client.rb:436 block in get_packet lib/mqtt/client.rb:435 loop lib/mqtt/client.rb:435 get_packet lib/mqtt/client.rb:404 get bin/mqtt_consumer:14 consume_messages bin/mqtt_consumer:26

lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55 load lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55 load lib/rails/commands/runner/runner_command.rb:38 perform lib/thor/command.rb:27 run lib/thor/invocation.rb:126 invoke_command lib/thor.rb:387 dispatch lib/rails/command/base.rb:69 perform lib/rails/command.rb:46 invoke lib/rails/commands.rb:18
lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 require lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21 block in require_with_bootsnap_lfi lib/bootsnap/load_path_cache/loaded_features_index.rb:65 register lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20 require_with_bootsnap_lfi lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29 require lib/active_support/dependencies.rb:291 block in require lib/active_support/dependencies.rb:257 load_dependency lib/active_support/dependencies.rb:291 require bin/rails:9

prasadpilla commented 4 years ago

Just figured this is probably nothing to do with the lib itself. Some process is sending SIGTERM. Thanks