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
We recently ran into an issue with our application locking up while trying to fetch feature flags. After some investigation, we determined it's because requests made by the Temporal SDK do not time out by default. This behavior contradicts the official documentation here:
...
# The network timeout in seconds.# Optional.# Defaults to 10 secondsrequest_timeout_seconds=10,
...
You can see here and here that the timeout actually defaults to None, and here is passed directly to the Requests module. The Requests module documentation states that
By default, requests do not time out unless a timeout value is set explicitly. Without a timeout, your code may hang for minutes or more.
This is the behavior we were seeing with Flagsmiths intermittent issues this week. Frequently, we would be unable to connect to Flagsmith's servers and would hang until the process was killed by Gunicorn.
Versions
This appears to affect all recent versions of the Flagsmith Python SDK
Solution
A simple fix would be to change (this line )[https://github.com/Flagsmith/flagsmith-python-client/blob/d59b7a3f04f30bd118d1d8c24ba0e6b41804a2d5/flagsmith/flagsmith.py#L52] to
If the maintainers agree that the documentation is correct, and a 10 second default timeout is the intended behavior, I can make this change. Otherwise, official documentation should be updated to reflect this behavior.
The text was updated successfully, but these errors were encountered:
Hi @nathan-beam , thanks for raising this, and for the detailed issue description.
Firstly, I'd like to apologise for the issues you experienced because of this, and because of the recent intermittent errors.
Regarding the resolution, given that the documentation states that a default timeout of 10 seconds is in place, I certainly think that we should update the SDK to adhere to that. If you're happy to implement that, then please do send over a PR and we'll get it reviewed and merged asap.
Problem
We recently ran into an issue with our application locking up while trying to fetch feature flags. After some investigation, we determined it's because requests made by the Temporal SDK do not time out by default. This behavior contradicts the official documentation here:
You can see here and here that the timeout actually defaults to None, and here is passed directly to the Requests module. The Requests module documentation states that
This is the behavior we were seeing with Flagsmiths intermittent issues this week. Frequently, we would be unable to connect to Flagsmith's servers and would hang until the process was killed by Gunicorn.
Versions
This appears to affect all recent versions of the Flagsmith Python SDK
Solution
A simple fix would be to change (this line )[https://github.com/Flagsmith/flagsmith-python-client/blob/d59b7a3f04f30bd118d1d8c24ba0e6b41804a2d5/flagsmith/flagsmith.py#L52] to
If the maintainers agree that the documentation is correct, and a 10 second default timeout is the intended behavior, I can make this change. Otherwise, official documentation should be updated to reflect this behavior.
The text was updated successfully, but these errors were encountered: