You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the lastPingSent is a fraction of a second after the lastPingResponse
Believe the issue is that the ping response is received pretty much instantly. Moving the lastPingSent = time.Now() above the packets.NewControlPacket(packets.PINGREQ).WriteTo(conn) should solve this (have this running). However this fix would also increase the possibility of timeouts occurring when the connection is highly utilised; so will have a think about better options.
Expected behaviour
Don't really expect timeouts with this setup (could happen very occasionality)
Software used:
Server was Mosquitto 2.0.18
Client version 0.20
The text was updated successfully, but these errors were encountered:
MattBrittan
added a commit
to ChIoT-Tech/paho.golang
that referenced
this issue
Feb 12, 2024
When running locally, there is a chance that `NewControlPacket(packets.PINGREQ).WriteTo(conn)`
may return after the ping response has been handled. This led to invalid timeouts.
Closeseclipse#237
Describe the bug
Connecting to a local (client and broker in docker containers; host is EC2 VM) broker and seeing occasional disconnections due to
PINGRESP timed out
.To reproduce
Don't have a reproducer; however added info to the error (
return fmt.Errorf("PINGRESP timed out (%v, %v)", lastPingSent, lastPingResponse)
) and got:So the
lastPingSent
is a fraction of a second after thelastPingResponse
Believe the issue is that the ping response is received pretty much instantly. Moving the
lastPingSent = time.Now()
above thepackets.NewControlPacket(packets.PINGREQ).WriteTo(conn)
should solve this (have this running). However this fix would also increase the possibility of timeouts occurring when the connection is highly utilised; so will have a think about better options.Expected behaviour
Don't really expect timeouts with this setup (could happen very occasionality)
Software used:
The text was updated successfully, but these errors were encountered: