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 retry logic to Submit-PnPSearchQuery #3528

Merged

Conversation

koskila
Copy link
Contributor

@koskila koskila commented Oct 22, 2023

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #3454 (?)

What is in this Pull Request ?

This Pull Request offers one possible fix to issue #3454 by implementing a simple retry (with a switch called -RetryCount) for trying a failed search call again for x times. No upper limit, but backoff is incremental so it won't bombard the API.

My first implementation used Reflection to figure out what sort of an exception it is to make it possible to fail for some and retry others - but I don't have a good list of which exceptions are transient and which aren't, and some can be either one (like arguably the most usual one, "Microsoft.Office.Server.Search.Query.InternalQueryErrorException") so that differentiation doesn't necessarily make sense anyway... 🙄

I updated the documentation to include the new switch.

@KoenZomers
Copy link
Collaborator

Nice one @koskila . Thanks for contributing. Made a small modification. Let's merge this into our nightlies and see if all works well and modify if needed.

@KoenZomers KoenZomers merged commit 372dfd4 into pnp:dev Nov 7, 2023
2 of 3 checks passed
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.

[BUG] Submit-PnPSearchQuery Timeout and Errors
3 participants