-
Notifications
You must be signed in to change notification settings - Fork 877
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
Log WARN for failed RPC response #8138
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Luis Pinto <[email protected]>
72788c3
to
fd4db28
Compare
lazyTraceLogger(() -> getJsonObjectMapper().writeValueAsString(jsonRpcResponse)); | ||
} else { | ||
LOG.warn("RPC error: {}", getJsonObjectMapper().writeValueAsString(jsonRpcResponse)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be pretty heavy on RPC nodes, I’m thinking of “Block not found” errors for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, this could potentially blow up the logs for a lot of users, even if they are genuine issues.
Maybe we need some sort of log throttling mechanism to go with it?
Would favour the more specific METHOD_NOT_FOUND but unless we also have throttling, I think we'd still need some confidence about the impact of this on a variety of usecases/networks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the change in principle but it's a potentially noisy, maybe even dangerous change (e.g. disk issues due to over-logging) for existing poorly configured systems.
Btw, I think this may fix the root cause of the RPC method not being enabled
#8136
lazyTraceLogger(() -> getJsonObjectMapper().writeValueAsString(jsonRpcResponse)); | ||
} else { | ||
LOG.warn("RPC error: {}", getJsonObjectMapper().writeValueAsString(jsonRpcResponse)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, this could potentially blow up the logs for a lot of users, even if they are genuine issues.
Maybe we need some sort of log throttling mechanism to go with it?
Would favour the more specific METHOD_NOT_FOUND but unless we also have throttling, I think we'd still need some confidence about the impact of this on a variety of usecases/networks.
Hmm, but isn't the problem altogether about missing a definition that should be there? I don't understand how this could solve as it just moves the potential problem to a missing definition in the milestones now. |
PR description
While debugging an acceptance test on the verkle branch I noticed that the cause of failure was an RPC method that was not added to the collection of supported RPC methods here.
However, without enabling TRACE logging it was impossible to see what was wrong as looking for WARN or ERROR was the first thing that came to mind. I think errors like this should not be hidden within TRACE and logging at least a warning when an RPC call fails is a must have for troubleshooting.
I don't think I'm missing any case where an
RpcResponseType.ERROR
might be legit, if so I can try limiting it toRpcErrorType.METHOD_NOT_ENABLED
.Before
After
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests