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 GetWorkItems stream connection #72

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

famarting
Copy link
Contributor

fix for #70

This PR adds infinite retries (with exponential backoff up to 15s) to the GetWorkItems call in the client worker. IMO it makes sense to do infinite retries, since the function is not blocking the user and the function signature does not allow to pass errors asynchronously, the only control the user has over StartWorkItemListener is via the context passed as parameter.

Also it makes sense to retry forever since the user would expect this work item listener to be reliable in order to always receive and process work.

@famarting
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Diagrid"

Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for this PR! Can you confirm that these changes were tested to ensure correct behavior?

@famarting
Copy link
Contributor Author

yes, I've been testing it for days now

== APP - wf2 == INFO: 2024/06/20 14:47:24 successfully reconnected work item listener stream...
== APP - wf2 == ERROR: 2024/06/20 14:49:25 background processor received stream error: rpc error: code = Unavailable desc = error reading from server: EOF
== APP - wf2 == WARNING: 2024/06/20 14:49:25 received grpc error code Unavailable
== APP - wf2 == INFO: 2024/06/20 14:49:25 reconnecting work item listener stream
== APP - wf2 == INFO: 2024/06/20 14:49:25 successfully reconnected work item listener stream...
== APP - wf2 == ERROR: 2024/06/20 14:51:25 background processor received stream error: rpc error: code = Unavailable desc = error reading from server: EOF
== APP - wf2 == WARNING: 2024/06/20 14:51:25 received grpc error code Unavailable
== APP - wf2 == INFO: 2024/06/20 14:51:25 reconnecting work item listener stream
== APP - wf2 == INFO: 2024/06/20 14:51:37 successfully reconnected work item listener stream...

@cgillum cgillum merged commit bfcc333 into microsoft:main Jun 21, 2024
4 checks passed
@famarting famarting deleted the client-worker-retries branch June 21, 2024 08:35
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