Skip to content

Commit 2320441

Browse files
authored
Include validator address in gRPC status log. (#3312)
## Motivation The gRPC status log currently does not show which validator connection it is about. ## Proposal Include the validator address in the log. ## Test Plan CI Example log: `2025-02-12T16:56:00.764092Z ERROR linera::main:node_service{port=8080}:subscribe{address="https://linera-testnet.contributiondao.com:443"}:notification stream: linera_rpc::grpc::client: Unexpected gRPC status: status: Internal, message: "h2 protocol error: error reading a body from connection", details: [], metadata: MetadataMap { headers: {} }` ## Release Plan - These changes should released in a new SDK. - They should be ported to the `main` branch. ## Links - Related to #3300 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 00854a0 commit 2320441

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

linera-rpc/src/grpc/client.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ impl ValidatorNode for GrpcClient {
253253
})
254254
.flatten();
255255

256+
let span = tracing::info_span!("notification stream");
256257
// The stream of `Notification`s that inserts increasing delays after retriable errors, and
257258
// terminates after unexpected or fatal errors.
258259
let notification_stream = endlessly_retrying_notification_stream
@@ -267,9 +268,11 @@ impl ValidatorNode for GrpcClient {
267268
retry_count = 0;
268269
return future::Either::Left(future::ready(true));
269270
};
271+
let _enter_span = span.enter();
270272
if !Self::is_retryable(status) || retry_count >= max_retries {
271273
return future::Either::Left(future::ready(false));
272274
}
275+
drop(_enter_span);
273276
let delay = retry_delay.saturating_mul(retry_count);
274277
retry_count += 1;
275278
future::Either::Right(async move {

0 commit comments

Comments
 (0)