-
Notifications
You must be signed in to change notification settings - Fork 738
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
Fail to reconnect after many published data queued (mqtt_client timed out waiting for CONNACK) #889
Comments
After I added #842, "mqtt_client timed out waiting for CONNACK" has fixed. |
Now I realized that "max_retry_time_in_secs=0" means retry forever, and would not call connectionStatusCallback(IOTHUB_CLIENT_CONNECTION_RETRY_EXPIRED). Hope there is a mechanism: When the max retry count reached, a connectionStatusCallback(IOTHUB_CLIENT_CONNECTION_RETRY_EXPIRED) occur, but connection still retry forever. Or provide a API for user to retry the connection which retry_action has been RETRY_ACTION_STOP_RETRYING. |
Hi @qiying ,
You can define the maximum retry timeout using the last argument above. Does that address your concern? |
Hi, now I know where is the problem.
now this problem has fixed from #842 After this problem solved, I still have another problem: Normally, disconnection status callback(no network) occurs if the messages is published seldom. But, if I publish messages too frequently (10times/1sec) by IoTHubDeviceClient_SendEventAsync(), when the network lost, there is not disconnection status callback occurs. I have to get the disconnection status callback. I think when messages are published too frequently, azure SDK does not have time to close socket completely, so disconnection status callback(no network) would not occur. This may be a problem azure SDK should fix. I use MQTT only. |
Hi, here is some logs. If messages is published seldom, I can get disconnection status callback:
If messages is published frequently, I cannot get disconnection status callback:
something may wrong with |
I will pick up investigating this. |
An update: I have tried reproducing this using the LL layer to see if it is an issue with the DoWork loop being blocked when a message is sent every DoWork. To simulate a similar scenario I have a sample using the LL layer on Windows 10 using MQTT doing the following:
Doing this, I received error messages that showed the connection status callback being invoked:
So from this, the connection_status_callback is being invoked in the LL (non-threaded) layer. If there is an issue it is involving the threaded layer (the non _LL_ layer). |
Hi @qiying apologies for getting to this slowly. I've repro'd it using the convenience sample using MQTT and still in the convenience sample I am seeing that the connection status callback is still being invoked. Could you verify on your end that the connection status callback. It could be specific to the TLS stack on your embedded device. Here's the gist with the logs I'm getting: https://gist.github.com/YoDaMa/022546ac983f6eb4814bb7cf4482be2e#file-multithreaded-log |
@qiying since I was unable to repro this I am going to close this github issue. |
@qiying, @ewertons, @YoDaMa, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey |
Hi, seeing the below logs. 2019-10-14T09:52:20.517980+00:00 ClickShare-1862300213 iotagent[733]: [ERROR] AZURE_PLATFORM: ERROR: Failure: getaddrinfo failure -3. could you please help here.. retry is set with below option |
linux ver2.6 (Embedded System)
1.2.14
Description of the issue:
We are testing an exception:
Connect to iothub -> publish data -> disconnect network (unplug the network route) -> publish data -> connect network back -> publish data.
When there was only a few of data, every thing was fine: connection_status_callback(IOTHUB_CLIENT_CONNECTION_NO_NETWORK) would be shown when the network was disconnect. When the network was reconnected, azure sdk connected to iothub again successfully.
But when there were a lots of data (Thousands of MQTT packets) published at the period of disconnection, no connection_status_callback was occurred. Nevertheless, after we plunged the network route back, azure sdk could not connect to iothub no longer.
Code sample exhibiting the issue:
main code which only was called once:
status callback function:
Publish cyclic data:
Console log of the issue:
If there was only a few data published during the period of disconnection, every thing was fine:
If there was a lots of data published during the period of disconnection, no connection_status_callback occurred, and azure sdk could not reconnect to iothub :
And then, try to reconnect...but show the message below continuously:
The text was updated successfully, but these errors were encountered: