-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
When client is receiving "long processing" topics, it will be disconnect at some point. #829
Comments
Maybe this is related? #755. As far as I understood it, this is a bug in the server? |
Not sure if it is a server bug. I logged the following message comming from MqttClient.TrySendKeepAliveMessagesAsync()
It seems the server doesn't response to the ping (keep alive) request. |
Maybe Mosquitto has some timeouts set or some size limits? |
Hi, This is the same bug as mentioned in #790. The issue is with the MqttClient. The ping is sent to the server and the server responds (I checked with wireshark) and then the Mqtt client timesout for some reason (the MqttCommunicationTimeOutException). We resolved this issue by creating a local queue and storing the received messages there. Then mqtt is only responsible for sending and receiving messages while another task is responsible for executing the received message. |
@Rochlop I'm thinking on the very same approach, but... what are you doing when your local queue is full? Maybe unsubscribe the topic while the local worker consume the local queue and then resubscribe? |
@ghc4 we currently have a background service consuming from the queue and the queued message is then processed in another thread using Task.Run(), so the background service is always able to consume from the queue. Although, in our use case, we do not have more than maybe 10 messages being run at the same time, so I am not so sure that this is the best use case for you. |
This commit fixes issues which were caused by processing messages synchronously in the packet receiver loop. This blocked KeepAlive and Ack packets from being processed while a message was processed. Fixes dotnet#648 Fixes dotnet#829
This commit fixes issues which were caused by processing messages synchronously in the packet receiver loop. This blocked KeepAlive and Ack packets from being processed while a message was processed. Fixes dotnet#648 Fixes dotnet#829
This commit fixes issues which were caused by processing messages synchronously in the packet receiver loop. This blocked KeepAlive and Ack packets from being processed while a message was processed. Fixes dotnet#648 Fixes dotnet#829
This commit fixes issues which were caused by processing messages synchronously in the packet receiver loop. This blocked KeepAlive and Ack packets from being processed while a message was processed. Fixes dotnet#648 Fixes dotnet#587 Fixes dotnet#829
In my application I want to receive images, do some modifications and save it. To simulate a "worst case" scenarios I put a Thread.Sleep(500) delay in the MqttClient.ApplicationReceiveHandler.
When publishing that topic about 100 times in a for loop, the subscribing client droppes the connection at some point. The server log shows "client xxx has exceeded timeout, disconnecting."
I tried to set the .WithKeepAlivePeriode up to 5 minutes. And then it worked!
It seems, when processing a long receiving queue, the KeepAlive signal could not be processed as long as the topic queue is not dequeued (processed).
The text was updated successfully, but these errors were encountered: