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

peer-server: connect lazily #663

Merged
merged 1 commit into from
Nov 15, 2023
Merged

peer-server: connect lazily #663

merged 1 commit into from
Nov 15, 2023

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Nov 15, 2023

While running dev-peerdb.sh I saw peer-server failing due to grpc connection taking too long. Replace connect_with_retries with tonic's connect_lazy

Also remove health check, if commandline includes grpc endpoint that endpoint should be used, regardless of health

The underlying principle of this PR is that grpc server should be able to come up & down as it pleases & peer-server will use it when it's up (& ideally fail loudly but non-terminally while it's down). I'm not sure this PR achieves that principle tho

While running `dev-peerdb.sh` I saw peer-server failing due to grpc connection taking too long. Replace connect_with_retries with tonic's connect_lazy

Also remove health check, if commandline includes grpc endpoint that endpoint should be used, regardless of health
@serprex serprex requested a review from iskakaushik November 15, 2023 16:34
@@ -349,24 +317,21 @@ impl FlowGrpcClient {
self.start_query_replication_flow(&cfg).await
}

pub async fn is_healthy(&mut self) -> anyhow::Result<bool> {
pub async fn is_healthy(&mut self) -> bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed signature to bool since this function was always returning Ok(bool). This function is no longer used

@serprex serprex requested a review from heavycrystal November 15, 2023 16:35
@heavycrystal
Copy link
Contributor

verified by manually killing flow and restarting peerdb-server, all statements that don't need flow API work as expected.

minor issue with misleading logs, this appears even if MIRROR commands are not enabled:

peerdb-server         | 2023-11-15T17:11:40.672939Z  INFO Listening on 0.0.0.0:9900
peerdb-server         | 2023-11-15T17:11:40.672955Z  INFO MIRROR commands enabled

@serprex
Copy link
Contributor Author

serprex commented Nov 15, 2023

Enabled/Disabled message is whether the argument was passed in. Maybe makes sense to remove logging that since it's just telling the user what command line arguments they passed in

@serprex serprex merged commit 053f5bd into main Nov 15, 2023
12 checks passed
@serprex serprex deleted the grpc-lazy-connect branch December 19, 2023 16:37
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