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

downgrade parsing JSON-RPC params logs to debug/trace #1127

Merged
merged 1 commit into from
May 20, 2023

Conversation

niklasad1
Copy link
Member

@niklasad1 niklasad1 commented May 18, 2023

The reason behind this is that it's quite likely that parsing params in the server fails when the user passes in
the wrong params and doesn't really have to regarded as an error/warn.

So let's downgrade that along some others.

After this PR:

➜  jsonrpsee git:(na-downgrade-more-logs) ✗ gg "tracing::error\!"
client/transport/src/ws/mod.rs:                                                                         tracing::error!("Redirection failed: {:?}", e);
core/src/client/async_client/helpers.rs:                                tracing::error!("Dropping subscription {:?} error: {:?}", sub_id, err);
core/src/client/async_client/helpers.rs:                        tracing::error!("The server tried to close an invalid subscription: {:?}", sub_id);
core/src/client/async_client/helpers.rs:                                tracing::error!("Error sending notification, dropping handler for {:?} error: {:?}", notif.method, err);
core/src/client/async_client/helpers.rs:                        tracing::error!("Notification: {:?} not a registered method", notif.method);
core/src/client/async_client/helpers.rs:                tracing::error!("Send unsubscribe request failed: {:?}", e);
core/src/client/async_client/mod.rs:                                    tracing::error!("[backend]: {}", err);
core/src/client/async_client/mod.rs:                                    tracing::error!("[backend]: Could not send ping frame: {}", err);
core/src/server/helpers.rs:                             tracing::error!("Error serializing response: {:?}", err);
core/src/server/rpc_module.rs:                                          tracing::error!("Join error for blocking RPC method: {:?}", err);
➜  jsonrpsee git:(na-downgrade-more-logs) ✗ gg "tracing::warn\!"
client/transport/src/ws/mod.rs:                         tracing::warn!("set nodelay failed: {:?}", err);
client/transport/src/ws/mod.rs:                         tracing::warn!("set nodelay failed: {:?}", err);
core/src/client/async_client/helpers.rs:                        tracing::warn!("Received unknown batch response");
core/src/client/async_client/helpers.rs:                        tracing::warn!("Subscription {:?} is not active", sub_id);
core/src/client/async_client/helpers.rs:                        tracing::warn!("Subscription {:?} is not active", sub_id);
core/src/client/async_client/mod.rs:                            tracing::warn!("[backend]: Batch request already pending: {:?}", batch.ids);
core/src/client/async_client/mod.rs:                            tracing::warn!("[backend]: Batch request failed: {:?}", e);
core/src/client/async_client/mod.rs:                            tracing::warn!("[backend]: Notification failed: {:?}", e);
core/src/client/async_client/mod.rs:                            tracing::warn!("[backend]: Request failed: {:?}", e);
core/src/client/async_client/mod.rs:                            tracing::warn!("[backend]: Subscription failed: {:?}", e);
core/src/server/rpc_module.rs:                                                  tracing::warn!(
server/src/server.rs:           tracing::warn!("Could not set NODELAY on socket: {:?}", e);
server/src/transport/http.rs:                   tracing::warn!("Internal error reading request body: {}", e);
server/src/transport/http.rs:                           tracing::warn!("Subscriptions not supported on HTTP");
test-utils/src/mocks.rs:                                                        tracing::warn!("send response to subscription: {:?}", e);
test-utils/src/mocks.rs:                                                        tracing::warn!("send notification: {:?}", e);
test-utils/src/mocks.rs:                                                                tracing::warn!("send response to request error: {:?}", e);
test-utils/src/mocks.rs:                                                                tracing::warn!("send subscription id error: {:?}", e);
➜  jsonrpsee git:(na-downgrade-more-logs) ✗ gg "tracing::info\!"
examples/examples/core_client.rs:       tracing::info!("response: {:?}", response);
examples/examples/http.rs:                              |request: &hyper::Request<hyper::Body>, _span: &tracing::Span| tracing::info!(request = ?request, "on_request"),
examples/examples/http.rs:                              tracing::info!(size_bytes = chunk.len(), latency = ?latency, "sending body chunk")
examples/examples/http.rs:      tracing::info!("r: {:?}", response);
examples/examples/middleware.rs:                                        |request: &hyper::Request<hyper::Body>, _span: &tracing::Span| tracing::info!(request = ?request, "on_request"),
examples/examples/middleware.rs:                                        tracing::info!(size_bytes = chunk.len(), latency = ?latency, "sending body chunk")
examples/examples/ws.rs:        tracing::info!("response: {:?}", response);
examples/examples/ws_pubsub_broadcast.rs:       let fut1 = sub1.take(NUM_SUBSCRIPTION_RESPONSES).for_each(|r| async move { tracing::info!("sub1 rx: {:?}", r) });
examples/examples/ws_pubsub_broadcast.rs:       let fut2 = sub2.take(NUM_SUBSCRIPTION_RESPONSES).for_each(|r| async move { tracing::info!("sub2 rx: {:?}", r) });
examples/examples/ws_pubsub_with_params.rs:     tracing::info!("subscription with one param: {:?}", sub_params_one.next().await);
examples/examples/ws_pubsub_with_params.rs:     tracing::info!("subscription with two params: {:?}", sub_params_two.next().await);

@niklasad1 niklasad1 requested a review from a team as a code owner May 18, 2023 12:08
@niklasad1 niklasad1 changed the title fix: downgrade more logs to debug downgrade parsing JSON-RPC params logs to debug May 18, 2023
@niklasad1 niklasad1 changed the title downgrade parsing JSON-RPC params logs to debug downgrade parsing JSON-RPC params logs to debug/trace May 18, 2023
@niklasad1 niklasad1 merged commit 4945098 into master May 20, 2023
15 checks passed
@niklasad1 niklasad1 deleted the na-downgrade-more-logs branch May 20, 2023 10:14
@lexnv lexnv mentioned this pull request Jul 20, 2023
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.

None yet

3 participants