Skip to content

Commit

Permalink
fix redis error reporting (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Nov 4, 2022
1 parent 25f2621 commit 6976fef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion shotover-proxy/src/config/topology.rs
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
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

0 comments on commit 6976fef

Please sign in to comment.