Skip to content

Commit 04f61de

Browse files
authored
[testnet] Log gRPC status as Debug, not Display. (#4760)
Backport of #4761. ## Motivation The `Display` impl of `Status` omits the source. ## Proposal Use `Debug` instead. ## Test Plan This should help with debugging some of the gRPC issues we are seeing on the testnet. ## Release Plan - These changes should be released in a new SDK. ## Links - PR to main: #4761 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 247adc3 commit 04f61de

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

linera-core/src/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub enum NodeError {
284284
CannotResolveValidatorAddress { address: String },
285285
#[error("Subscription error due to incorrect transport. Was expecting gRPC, instead found: {transport}")]
286286
SubscriptionError { transport: String },
287-
#[error("Failed to subscribe; tonic status: {status}")]
287+
#[error("Failed to subscribe; tonic status: {status:?}")]
288288
SubscriptionFailed { status: String },
289289

290290
#[error("Node failed to provide a 'last used by' certificate for the blob")]

linera-indexer/lib/src/grpc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ where
9595
Err(error) => {
9696
// If there was an error, return it
9797
let status = Status::from(error);
98-
error!("Error processing element: {}", status);
98+
error!("Error processing element: {status:?}");
9999
return Some((
100100
Err(status),
101101
(input_stream, database, pending_blobs),

linera-rpc/src/cross_chain_message_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub(crate) async fn forward_cross_chain_queries<F, G>(
6060
if let Err(error) = run_task(state.task).await {
6161
warn!(
6262
nickname = state.nickname,
63-
%error,
63+
?error,
6464
retry = state.retries,
6565
from_shard = this_shard,
6666
to_shard,

linera-rpc/src/grpc/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ impl GrpcClient {
7171
fn is_retryable(status: &Status) -> bool {
7272
match status.code() {
7373
Code::DeadlineExceeded | Code::Aborted | Code::Unavailable | Code::Unknown => {
74-
info!("gRPC request interrupted: {}; retrying", status);
74+
info!("gRPC request interrupted: {status:?}; retrying");
7575
true
7676
}
7777
Code::Ok | Code::Cancelled | Code::ResourceExhausted => {
78-
info!("Unexpected gRPC status: {}; retrying", status);
78+
info!("Unexpected gRPC status: {status:?}; retrying");
7979
true
8080
}
8181
Code::NotFound => false, // This code is used if e.g. the validator is missing blobs.
@@ -88,7 +88,7 @@ impl GrpcClient {
8888
| Code::Internal
8989
| Code::DataLoss
9090
| Code::Unauthenticated => {
91-
info!("Unexpected gRPC status: {}", status);
91+
info!("Unexpected gRPC status: {status:?}");
9292
false
9393
}
9494
}

0 commit comments

Comments
 (0)