-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add retries to Data.read #11269
Add retries to Data.read #11269
Conversation
A quick solution to random network failures for GET HTTP requests. Should reduce the number of IOExceptions that users see while fetching data.
Previously, we added retries only to fetch HTTP_Request. That was insufficient as intermittent errors might happen while reading body's stream. Enhanced our simple server's crash endpoint to allow for different kind of failures as well as simulate random failures.
Increased the scope of retries in the previous commit.
distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Data_Read_Helpers.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Data_Read_Helpers.enso
Show resolved
Hide resolved
## PRIVATE | ||
ADVANCED | ||
Temporarily cease execution of the current thread. | ||
|
||
Arguments: | ||
- time: amount of milliseconds to sleep | ||
|
||
> Example | ||
Sleep the current thread for 1 second. | ||
|
||
Thread.sleep 1000 <| IO.println "I continue!" | ||
sleep : Integer | ||
sleep time_in_milliseconds = @Builtin_Method "Thread.sleep" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to get this as a builtin, I was always polyglot java import java.lang.Thread
, but this seems so much nicer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather limit builtins to a bare minimum. Especially something that doesn't have to be fast as sleep
doesn't indicate any need to be a builtin.
distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Data_Read_Helpers.enso
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/thread/SleepNode.java
Outdated
Show resolved
Hide resolved
tools/http-test-helper/src/main/java/org/enso/shttp/test_helpers/CrashingTestHandler.java
Outdated
Show resolved
Hide resolved
tools/http-test-helper/src/main/java/org/enso/shttp/test_helpers/CrashingTestHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just some small suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why builtin and not polyglot java import java.lang.Thread
?
distribution/lib/Standard/Base/0.0.0-dev/src/Runtime/Thread.enso
Outdated
Show resolved
Hide resolved
See @radeusgd's response (#11269 (comment)). I'm not the only one who found it missing in the current API. |
engine parts have been removed and this PR is quite important to get in and fix ongoing stability issues
Pull Request Description
This change adds simple retries with exponential backoff. It's very simple and that's on purpose - a more advanced retry mechanism would need to be exposed in the API, which eventually might happen.
For now, this change attempts to address one of the most annoying intermittent failures in GUI, #11084.
Important Notes
No more random failures like:
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.