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

Retry on Gateway Timeout (504) errors #1048

Closed
1 of 4 tasks
mrebuffet opened this issue Feb 3, 2020 · 3 comments · Fixed by #1053
Closed
1 of 4 tasks

Retry on Gateway Timeout (504) errors #1048

mrebuffet opened this issue Feb 3, 2020 · 3 comments · Fixed by #1053

Comments

@mrebuffet
Copy link

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the Docs to see if your question is already addressed there. This will help us ensure our documentation covers the most frequent questions.

Category

  • Enhancement
  • Bug
  • Question
  • Documentation gap/issue

Version

Please specify what version of the library you are using: [ Version-1 ]

Please specify what version(s) of SharePoint you are targeting: [ SharePoint Online ]

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior / Question

Since it is my first time contributing on this project, I thought it would be best to open an issue before suggesting a Pull Request.
We would like failed http requests to be retried when the server replies with a Gateway Timeout (504) within the SPHttpClient or the GraphHttpClient classes.

The Graph API expects to encounter these issues internally and the caller has no way to avoid them. Here's the definition of a 504 from the Graph error code documentation: https://docs.microsoft.com/en-us/graph/errors
504 | Gateway Timeout | The server, while acting as a proxy, did not receive a timely response from the upstream server it needed to access in attempting to complete the request. May occur together with 503.

This has led us to have to develop our own retry handling code outside of PnPJS for this error code following the description on this issue: #248 but I think it should be included in the normal error handling.

Should this enhancement be approved I have a PR ready for both V1 and V2.

Thank you for all the great work done so far it helped us a lot.

Observed Behavior

Only the requests returning an error code of 429 and 503 are retried.
504 errors do not result in a retry.

Steps to Reproduce

Unfortunately, this can't be reliably reproduced due to the nature of the internal timeout.

@patrick-rodgers
Copy link
Member

Sure, makes sense and should be an easy add. Let me know if you are good to do the PRs and we can aim to get them merged for the next release. Thanks!

@mrebuffet
Copy link
Author

Thank you @patrick-rodgers

@github-actions
Copy link

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.

@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants