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
Recently, when doing a deep dive into behavior in slow network environments, I can across the code in Updater.cpp that handles a timeout while an update is being streamed. Effectively, it will wait for 100ms after a timeout and then try once more. If this second attempt fails, the update fails. I would like to propose a change to this mechanism that makes the download succeed in even the slowest networks.
This change uses a call to millis() to track the start time, reseting this start time every time data is received. After 60 seconds of not receiving more data, it will timeout.
The new function is below with the new variable called "timeout":
Also, I read another thread recently with comments thanking you all for the incredible work you do on this project. One response was it is not common to get thanks, so here is another. THANK YOU!!
The text was updated successfully, but these errors were encountered:
rewrite your timeout change in terms of polledTimeout. That is a class that encapsulates precisely what you are trying to do. There are examples for it included in the core.
make the timeout value a constexpr, or at least a define to allow easy configuring. I think 60s is way too long, but we can discuss that.
make a PR with your proposal so that we can review and discuss in detail.
I created a pull request and added the timeout value as an optional parameter.
The reason I chose 60 seconds was from looking at some downloads on a very slow network. It is likely a bit high, but I would not go lower than about 30 seconds. The original timeout mechanism would create about a 16 second timeout.
I did not use the polledTimeout task since I thought this was quite a simple solution?
Recently, when doing a deep dive into behavior in slow network environments, I can across the code in Updater.cpp that handles a timeout while an update is being streamed. Effectively, it will wait for 100ms after a timeout and then try once more. If this second attempt fails, the update fails. I would like to propose a change to this mechanism that makes the download succeed in even the slowest networks.
This change uses a call to millis() to track the start time, reseting this start time every time data is received. After 60 seconds of not receiving more data, it will timeout.
The new function is below with the new variable called "timeout":
Also, I read another thread recently with comments thanking you all for the incredible work you do on this project. One response was it is not common to get thanks, so here is another. THANK YOU!!
The text was updated successfully, but these errors were encountered: