Skip to content

fix(pubsub): retry connecting to backend #2254

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 2 commits into from
Mar 28, 2025
Merged

fix(pubsub): retry connecting to backend #2254

merged 2 commits into from
Mar 28, 2025

Conversation

yash-atreya
Copy link
Member

Motivation

Closes #2252

Solution

  • retry mechanism in PubsubService
  • Retries at least 10 times before exiting
  • Interval between retires is 3 seconds

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

makes sense,

this is better than terminating the task

smol nit

break Err(e)
}
}

_ = &mut self.handle.error => {
error!("Pubsub service backend error.");
if let Err(e) = self.reconnect().await {
error!("Reconnect failed, shutting down: {e}");
Copy link
Member

Choose a reason for hiding this comment

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

I think we still want this error message

Copy link
Member Author

Choose a reason for hiding this comment

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

@github-project-automation github-project-automation bot moved this to Reviewed in Alloy Mar 28, 2025
@yash-atreya yash-atreya marked this pull request as ready for review March 28, 2025 13:22
Comment on lines +208 to +213
error!(
"Reconnect failed after {} attempts, shutting down: {e}",
retry_count
);
break Err(e);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

It prints here @mattsse

@mattsse mattsse merged commit 9fee1e8 into main Mar 28, 2025
27 checks passed
@mattsse mattsse deleted the yash/fix-pubsub branch March 28, 2025 13:25
@github-project-automation github-project-automation bot moved this from Reviewed to Done in Alloy Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] No custom policy and no retry is done for disconnected web socket
2 participants