bytebeamio / rumqtt

The MQTT ecosystem in rust
Apache License 2.0
1.64k stars 252 forks source link

An Error = MqttState(AwaitPingResp) error occurred when creating a connection using rumqttc v5 #801

Closed zmjssm closed 9 months ago

zmjssm commented 9 months ago

image

zmjssm commented 9 months ago

I didn't have this problem with version 0.22.0 before

swanandx commented 9 months ago

Hey @zmjssm , which broker are you using? this might be issue related to broker and not rumqttc.

I tried with rumqttd, and latest main branch ( and also the 0.23.0 ) version seems to work fine with the code you provided. I wasn't able to reproduce it.

the AwaitPingResp gets triggered when there are previously pending ping request and we try to ping again.

In logs provided in your screenshot, you can see an Outgoing(PingReq), but broker never responded back with anything, as the keepalive time passed ( 100s passed without receiving anything in this case ), rumqttc tried to send ping but saw the previously pending request, and hence generated the error.

lmk if that makes sense, thank you!

swanandx commented 9 months ago

i will be closing the issue, feel free to reopen it if required :)