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

Handle missing connections without panicking. #92

Merged

Conversation

nihohit
Copy link

@nihohit nihohit commented Dec 31, 2023

Issue #, if available:
valkey-io/valkey-glide#733

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nihohit nihohit force-pushed the no-connection-panic branch 3 times, most recently from 88df05c to 089a045 Compare December 31, 2023 17:56
@@ -461,17 +470,16 @@ impl<C> Future for Request<C> {
self.respond(Err(err));
return Next::Done.into();
}
OperationTarget::NoTargetFound => {
warn!("No connection found: `{err}`");
Copy link

Choose a reason for hiding this comment

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

can you also log the RequestInfo

Copy link
Author

Choose a reason for hiding this comment

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

What part of the request info? We don't log commands, because they might contain PPI.

@@ -1165,18 +1174,16 @@ where
}
InternalSingleNodeRouting::SpecificNode(route) => read_guard
.connection_for_route(&route)
.map_or(ConnectionCheck::Nothing, ConnectionCheck::Found),
InternalSingleNodeRouting::Random => ConnectionCheck::Nothing,
.map_or(ConnectionCheck::RandomConnection, ConnectionCheck::Found),
Copy link

Choose a reason for hiding this comment

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

We should note that if the user do some request with a specific node route, and this node isn't found, we will route it to a random node. If the command is key-based, there's no harm. however, if the command is for example flushall, config set, or other management command - it will be transparent to the user.
We might want to add a warning here

Copy link
Author

Choose a reason for hiding this comment

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

done

@nihohit nihohit force-pushed the no-connection-panic branch from 089a045 to 5495b3f Compare January 1, 2024 16:58
@shachlanAmazon shachlanAmazon merged commit 9850815 into amazon-contributing:main Jan 2, 2024
9 of 10 checks passed
@nihohit nihohit deleted the no-connection-panic branch January 2, 2024 16:14
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