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

Use configured lazy connect channel in sync service #627

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

roeierez
Copy link
Member

Before this PR after some time the sync requests started to receive transport errors. It seems that the default keep alive settings are not working well for this service and we have to configure the underline grpc channel properly.
Also the way we inject the API key has changed a bit to a more centralised point to keep the API calls cleaner.

Copy link
Member

@hydra-yse hydra-yse left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding the interceptor 👍

Copy link
Collaborator

@dangeross dangeross left a comment

Choose a reason for hiding this comment

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

LGTM, with a nit

&self,
) -> Result<ProtoSyncerClient<InterceptedService<Channel, ApiKeyInterceptor>>, Error> {
let Some(channel) = self.grpc_channel.lock().await.clone() else {
return Err(anyhow!("Cannot run `set_record`: client not connected"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe a clearer error message?

Suggested change
return Err(anyhow!("Cannot run `set_record`: client not connected"));
return Err(anyhow!("Cannot get client: gRPC not available"));

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@roeierez roeierez merged commit ff811a8 into rt-sync Dec 23, 2024
9 checks passed
hydra-yse pushed a commit that referenced this pull request Dec 24, 2024
Use configured lazy connect channel in sync service
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.

3 participants