Skip to content
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

Client disconnect after 24 hours without raising exception #39

Closed
ghost opened this issue Apr 13, 2017 · 11 comments
Closed

Client disconnect after 24 hours without raising exception #39

ghost opened this issue Apr 13, 2017 · 11 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2017

When using the client with web socket, the mqtt client and shadow stop receiving updates from the service (broker or shadow updates).
I know that the web socket closes after 24 hours as listed in the aws-iot limitation.
However, the client is not raising any exception nor is it exposing any socket disconnect callback to handle this case.

@bxpan
Copy link

bxpan commented Apr 13, 2017

Hi Eyalbern,

Currently, the python sdk does not expose callback to client when it got disconnected, however, it should try to reconnect automatically by itself. Could you clarify if the problem you saw was that it does not reconnect automatically, and hence not able receive any further messages from server or publish any messages to server ? If so , do you have the logs for this period of time where it got disconnected but did not automatically attempted to reconnect ?

@ghost
Copy link
Author

ghost commented Apr 13, 2017

After 24 hours the client stop receiving updates from the service and not trying to reconnect, there are no warnings in the log (logger is set to DEBUG level).
however if the network disconnect before 24 hours the client is reconnecting when the network is back.and i get updates from the service.
As I understand its only when using web socket option.
Currently I have a timer that disconnects and reconnects every 23 hours, that way it continues to work nonstop.
I reach out to you for a more elegant solution to work with Aws-iot sdk.

@bxpan
Copy link

bxpan commented Apr 17, 2017

Hi Eyalbern,

This does not seem to be the expected behavior. The SDK should reconnect automatically after 24 hours. We will try to reproduce the issue and check further.

Thanks.

@ghost
Copy link
Author

ghost commented Apr 19, 2017

Very easy to reproduce:
Just connect the AWSIoTShadowClient with the web socket option.
Wait 24 hours
And see that AWSIoTShadowClient is stopped getting updates when changing the shadow.
Also you will see that there where no exceptions.

@khyew
Copy link

khyew commented Sep 26, 2017

I am seeing the same issue under the same conditions (watching for Shadow updates, using Websocket connection, >24hr uptime).

@thassman
Copy link

thassman commented Dec 4, 2017

I see the same error, any update on this?
What could i implement as a workaround?

@bxpan
Copy link

bxpan commented Dec 5, 2017

Hi thassman,

We'll plan to include the fix in our future (probably next) release of the aws-iot-device-sdk-python. For now as a workaround, you may try keeping a timer to count to 24 hours and then create a new client and connect.

Thanks.

@thassman
Copy link

thassman commented Dec 6, 2017

Thank you, i downgraded to sdk version 1.1.2 as disconnect did not work for me in 1.2

@liuszeng
Copy link
Contributor

liuszeng commented Dec 6, 2017

Addressed in v1.3.0.

@liuszeng liuszeng closed this as completed Dec 6, 2017
@jp-embedded
Copy link

I am having this issue in v1.3.1

@rabingaire
Copy link

Did this issue got fixed? I am still disconnected after 24 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants