Repository navigation
fix(spanner): avoid writing bound parameter values to SpannerException at FINEST logging - #15275
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request ensures that sensitive bound parameter values in SQL statements are never leaked through thrown SpannerExceptions, even when the logging level is set to FINEST. Instead, parameter values are strictly emitted within the FINEST log records. The changes include updates to GrpcStreamIterator, a new CapturingLogHandler test utility, and comprehensive unit tests verifying that parameters do not leak to exceptions, OpenTelemetry/OpenCensus spans, or retry logs. There are no review comments, and I have no feedback to provide.
olavloite
approved these changes
Dec 1, 2026
…n at FINEST logging - When `FINEST` logging is enabled for streaming queries in the Cloud Spanner Java client, bound query parameter values and query options are appended to the thrown `SpannerException` message. - Because the mutated exception is returned to callers and recorded by tracing integrations, sensitive bound parameter values can propagate beyond the `FINEST` log record into application error logs, retry logs, and OpenTelemetry/OpenCensus trace spans. - Always attach only the SQL text (without bound parameter values or query options) to `SpannerException` when a streaming query fails, regardless of the configured log level. - Emit the full statement including bound parameters strictly inside the `FINEST` log record message so opt-in `FINEST` diagnostics remain available without leaking parameter values into thrown exceptions or trace spans.
sakthivelmanii
force-pushed
the
fix/spanner-finest-param-leak
branch
from
December 1, 2026 14:37
fb47890 to
c907fc5
Compare
sakthivelmanii
enabled auto-merge (squash)
December 1, 2026 14:39
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.
Problem Statement
FINESTlogging is enabled for streaming queries in the Cloud Spanner Java client, bound query parameter values and query options are appended to the thrownSpannerExceptionmessage.FINESTlog record into application error logs, retry logs, and OpenTelemetry/OpenCensus trace spans.Solution
SpannerExceptionwhen a streaming query fails, regardless of the configured log level.FINESTlog record message so opt-inFINESTdiagnostics remain available without leaking parameter values into thrown exceptions or trace spans.