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

fix redis error reporting #898

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shotover-proxy/src/config/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Topology {
}

if !chain_errors.is_empty() {
return Err(anyhow!(format!("Topology errors\n{chain_errors}")));
return Err(anyhow!("Topology errors\n{chain_errors}"));
}

for (source_name, chain_name) in &self.source_to_chain_mapping {
Expand Down
12 changes: 6 additions & 6 deletions shotover-proxy/src/transforms/redis/sink_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl RedisSinkCluster {
self.connection_pool
.new_unpooled_connection(address, token)
.map_err(move |err| {
trace!("error fetching slot map from {}: {}", address, err);
trace!("error fetching slot map from {}: {:?}", address, err);
TransformError::from(err)
})
.and_then(get_topology_from_node)
Expand Down Expand Up @@ -313,7 +313,7 @@ impl RedisSinkCluster {
Err(err)
}
Err(err) => {
warn!("failed to build connections: {}", err);
warn!("failed to build connections: {:?}", err);
Err(err)
}
}
Expand All @@ -339,7 +339,7 @@ impl RedisSinkCluster {
}
Err(e) => {
// Intentional debug! Some errors should be silently passed through.
debug!("failed to connect to {}: {}", node, e);
debug!("failed to connect to {}: {:?}", node, e);
errors.push(e.into());
}
}
Expand Down Expand Up @@ -542,7 +542,7 @@ impl RedisSinkCluster {
if let Err(e) = CONTEXT_CHAIN_NAME.try_with(|chain_name| {
counter!("failed_requests", 1, "chain" => chain_name.to_string(), "transform" => self.get_name());
}) {
error!("failed to count failed request - missing chain name: {}", e);
error!("failed to count failed request - missing chain name: {:?}", e);
}
short_circuit(RedisFrame::Error(message.into()))
}
Expand Down Expand Up @@ -971,7 +971,7 @@ impl Transform for RedisSinkCluster {
responses.push_front(Box::pin(
self.choose_and_send(&server, original)
.await?
.map_err(|e| anyhow!("Error while retrying MOVE - {}", e)),
.map_err(|e| e.context("Error while retrying MOVE")),
));
}
Some(Redirection::Ask { slot, server }) => {
Expand All @@ -980,7 +980,7 @@ impl Transform for RedisSinkCluster {
responses.push_front(Box::pin(
self.choose_and_send(&server, original)
.await?
.map_err(|e| anyhow!("Error while retrying ASK - {}", e)),
.map_err(|e| e.context("Error while retrying ASK")),
));
}
None => response_buffer.push(response),
Expand Down