You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Hi @lugino-emeritus. This is a duplicate of #129. Would love a PR fixing it.
To answer your two points:
Any timeout defined in query_params should override the default timeout
in the same way we do now with Content-Type in the request headers. We
should add some reasonable length of time to the one specified in query-params for the request timeout rather than multiplying (maybe 10
seconds).
In any methods (like listen-forever that are designed not to return, we
should handle the timeout exception (I think listen-forever might be the
only one, but I'm not sure). Otherwise, an exception should be raised rather
than auto-retrying. Auto-retrying can be added when Make MatrixClient asynchronous #145 (or another PR
adding async to the client) is merged.
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:
request_timeout = 2 * query_params.get('timeout', 60000)/1000
)Moreover I have to search whether there are more requests in this code, and whether it is useful to add a timeout.
The text was updated successfully, but these errors were encountered: