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

Fixing hanging uploads #809

Merged
merged 2 commits into from
Sep 29, 2020
Merged

Fixing hanging uploads #809

merged 2 commits into from
Sep 29, 2020

Conversation

tanema
Copy link
Contributor

@tanema tanema commented Sep 28, 2020

fixes #790
fixes #801
fixes #810

Re-evaluating the retry mechanism, I realized that there was a fault in the if statements where the attempt count would only get incremented on timeouts and not for all other errors like 500s.

Here is the logic now

  • if non-retryable http status (success or otherwise), return (100 =< code <= 428)
  • if 499 then use retry-after header to block all requests until after the time limit then continue without incrementing attempt because this is not an error. I don't want to fail out of uploads because of 499s
  • If request failed with host error, its fatal, return
  • Otherwise, increment attempt and try again

Warn Checklist

  • This changes the interface and requires a Major/Minor version change.
  • I have 🎩'd these changes by using the commands I changed by hand.
  • I have added a dependancy to the project.
  • I have considered any potential impact on node-themekit

Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

LGTM


attempt++
if attempt > client.maxRetry {
return resp, fmt.Errorf("request failed after %v retries with err: %v", client.maxRetry, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

with error ?

@andyw8
Copy link
Contributor

andyw8 commented Sep 29, 2020

@tanema were you able 🎩 locally? Guess it may be awkward.

@andyw8 andyw8 mentioned this pull request Sep 29, 2020
@tanema
Copy link
Contributor Author

tanema commented Sep 29, 2020

I tophatted it with slow/timeouts and rate limits as well as the no host error/no connection errors.

@tanema tanema merged commit 614860f into master Sep 29, 2020
@tanema tanema deleted the fixing_hanging_uploads branch September 29, 2020 17:46
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.

Invalid memory address theme download gets stuck at 97% Crash when checking response status code
3 participants