Skip to content
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

Merged
merged 8 commits into from
Oct 10, 2024
Merged

Add retries to Data.read #11269

merged 8 commits into from
Oct 10, 2024

Conversation

hubertp
Copy link
Contributor

@hubertp hubertp commented Oct 8, 2024

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:
Screenshot from 2024-10-07 22-37-51

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

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.
@hubertp hubertp changed the title Wip/hubert/11084 retry hack Add retries to Data.read Oct 8, 2024
@hubertp hubertp added the CI: No changelog needed Do not require a changelog entry for this PR. label Oct 8, 2024
Comment on lines 24 to 36
## 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"
Copy link
Member

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

Copy link
Member

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.

Copy link
Member

@radeusgd radeusgd left a 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.

Copy link
Member

@JaroslavTulach JaroslavTulach left a 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?

@hubertp
Copy link
Contributor Author

hubertp commented Oct 9, 2024

Why builtin and not polyglot java import java.lang.Thread?

See @radeusgd's response (#11269 (comment)). I'm not the only one who found it missing in the current API.

@hubertp hubertp dismissed JaroslavTulach’s stale review October 10, 2024 08:25

engine parts have been removed and this PR is quite important to get in and fix ongoing stability issues

@hubertp hubertp merged commit 468b643 into develop Oct 10, 2024
36 checks passed
@hubertp hubertp deleted the wip/hubert/11084-retry-hack branch October 10, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants