-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection reset by peer (Errno::ECONNRESET) sending messages in a loop #29
Comments
After looking closer at the server logs I am seeing messages like this, maybe this helps point to the issue:
|
I had the same warning message when i was doing failure test of server side. To my mind, when the server shutdown, it might lost the id of the packet that where waiting for an acknowledgement (in QoS 2). |
I try to run this code for 2 second and I could acknowledge about 153 message. I do not understand well what happen, here is my thinking. While you were testing the server did some kind of reset or something that close the socket with the client. That it is why the client notice the connection close event and shutdown. In persistence mode, the client is enable to reconnect to the server when it show up again. However, because the server had reset, it lost the previous transmission ids that the client is still waiting for. |
Ah, that is possible, I am testing mosquitto in bridge mode, so it could be the bridge recovering maybe, this is the code I wrote to test mosquitto bridges: https://github.com/xanview/mosquitto-test |
Yes, this appears to be the case, once I added a random client_id, the problem went away. However if I used the same ID, killed the paho process, then started it again, it starts failing. Paho should handle this case without throwing an exception, no? |
Ah sorry my meaning was little different, I was talking about packet id, (used in transmission), not about client id (used in session). |
The generating ID was just me testing stuff. e.g. client_id = "client_#{(rand*1_000_000).to_i}"
$client = PahoMqtt::Client.new(username: 'testuser', password: 'testpasswd', client_id: client_id) |
I think that I could find the cause of those warning. I will release a new version (1.0.9) soon that should correct this bug. With this change, the code that you provide does not generate warning in my environment, and packets are resent properly. |
Will do, thank you :) |
The version 1.0.9 has just been released ! Could you try it and tell me if it fix this issues? |
Hi there,
I have this code:
When I run this code, it sends about 80-90 messages and then I get:
Adding persistent: true solves this, but I'm not seeing any errors in mosquitto, so it's strange this would be happening?
Any ideas?
The text was updated successfully, but these errors were encountered: