RubyDevInc / paho.mqtt.ruby

Eclipse Public License 1.0
31 stars 19 forks source link

NoMethodError: undefined method `in_transaction?' for nil:NilClass #50

Open rgaufman opened 6 years ago

rgaufman commented 6 years ago

In latest master, I get this exception from time to time:

#<Thread:0x00000000430f3348@/data/deployer/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/client.rb:198 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
    6: from /data/deployer/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/client.rb:203:in `block in reconnect'
    5: from /data/deployer/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/client.rb:118:in `connect'
    4: from /data/deployer/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/connection_helper.rb:43:in `do_connect'
    3: from /data/deployer/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/handler.rb:41:in `receive_packet'
    2: from /data/deployer/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/packet/base.rb:48:in `read'
    1: from /data/deployer/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/packet/base.rb:306:in `read_byte'
/data/deployer/timeline/current/vendor/cache/xanview-mqtt-92d6cd687553/vendor/paho.mqtt.ruby-master/lib/paho_mqtt/packet/base.rb:306:in `read': Connection reset by peer (Errno::ECONNRESET)
NoMethodError: undefined method `in_transaction?' for nil:NilClass

Any ideas?

p-goudet commented 6 years ago

Thank you for waiting. The reason seems to be that the client try to read from a closed socket, raising a not handled exception. I am keeping investigation, and I would try to write a fix soon.

rgaufman commented 3 years ago

Any update on this one? - this is still happening occasionally.