Skip to content

bug: requests.request running endless in some cases #149

Description

@lugino-emeritus

My router changes his ip every three days, and then this sdk does not reconnect to the server.
This request method does not return in that case, and so there is also no exception which could be handled.

Solution: add a timeout to the request.
I can do a pull request, but there are some points to discuss:

  • The timeout has to be larger than the timeout defined in the query_params. (if available). Should we use 60 seconds by default (if no timeout is available), otherwise 2*query_params['timeout'] (request_timeout = 2 * query_params.get('timeout', 60000)/1000)
  • Should we handle the possible timeout exception in listen_forever by default?

Moreover I have to search whether there are more requests in this code, and whether it is useful to add a timeout.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions