Log unknown exceptions in FallbackHandler unconditionally - #428
Open
yuxndjhdh wants to merge 1 commit into
Open
Conversation
FallbackHandler.handleException only logged when logger.isDebugEnabled() was true before invoking logger.error(...). Gating an ERROR-level log behind a DEBUG check inverts the usual convention: when nothing else handles the exception the fallback branch silently swallowed the causing exception at the default (INFO) logging level. Log unconditionally at ERROR so operators always see genuinely unhandled server exceptions; the returned Status is unchanged and the logger can still be silenced through normal logging configuration. Closes: spring-projectsgh-426 Signed-off-by: yuxndjhdh <148313905+yuxndjhdh@users.noreply.github.com>
yuxndjhdh
force-pushed
the
fix/426-fallbackhandler-exception-logging
branch
from
September 9, 2026 01:05
c06a81e to
7c960ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the
logger.isDebugEnabled()guard aroundlogger.error("Unknown exception", exception)inGrpcExceptionHandlerInterceptor.FallbackHandler.Why
GrpcExceptionHandlerrecognized the exception, i.e. a genuinely unhandled server-side fault.Statusand wire behavior are unchanged; teams that relied on the previous silence can still disable this logger through normal logging configuration.How it was checked
GrpcExceptionHandlerInterceptorTests#unknownExceptionIsLoggedWhenNoHandlerMatchesasserting the ERROR record is emitted.spring-grpc-corefull suite: 167 tests, 0 failures../mvnw -pl spring-grpc-core spring-javaformat:validatepasses.Closes gh-426