Skip to content

Add retry logic to inkuire fetch #13482

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

Merged
merged 1 commit into from
Sep 8, 2021

Conversation

pikinier20
Copy link
Contributor

Even after increasing timeout limit, inkuire fetch is still flaky. This PR adds retry logic to stabilize the process

Copy link
Contributor

@griggt griggt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments and a question, otherwise LGTM.

downloadProcess.destroy()
throw new MessageOnlyException(s"Failed to fetch inkuire.js from $inkuireLink: Download timeout")

def tryFetch(retries: Int, timeout: Int): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def tryFetch(retries: Int, timeout: Int): Unit = {
def tryFetch(retries: Int, timeout: Duration): Unit = {

Consider using Duration here and updating the code accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

tryFetch(retries - 1, timeout)
}
else {
downloadProcess.destroy()
Copy link
Contributor

@griggt griggt Sep 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want also want this call to downloadProcess.destroy() for the if branch above when we catch TimeoutException?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we should destroy process in both branches

@pikinier20 pikinier20 force-pushed the scaladoc/inkuire-retry branch from b88c504 to 1200580 Compare September 8, 2021 08:40
@pikinier20 pikinier20 merged commit 8e92478 into scala:master Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants