Skip to content

fix(bigquery-jdbc): replace String log parameter routing with typed ConnectionLogContext - #15254

Merged
Neenu1995 merged 1 commit into
mainfrom
fix/bq-jdbc-connection-log-context
Nov 28, 2026
Merged

Neenu1995 merged 1 commit into
mainfrom
fix/bq-jdbc-connection-log-context

Conversation

@Neenu1995

Copy link
Copy Markdown
Contributor

Stack: PR 4 of 6 (base: fix/bq-jdbc-log-rotation-and-context)
Bug: b/584840147

Summary

Replaces raw String LogRecord.getParameters()[0] connection-ID stamping with a package-private typed ConnectionLogContext carrier across BigQueryJdbcResultSetLogger, BigQueryJdbcRootLogger, PerConnectionFileHandler, and OpenTelemetryJulHandler.

Design Decisions

  • Collision-free parameter routing: Arbitrary String parameters at params[0] can no longer be misinterpreted as connection IDs or spawn unintended BQ-JDBC-*-<prefix>.log files when MDC is empty.
  • OpenTelemetry MessageFormat compatibility: OpenTelemetryJulHandler strips ConnectionLogContext at params[0] before positional message formatting.

@Neenu1995
Neenu1995 requested review from a team as code owners November 26, 2026 20:48

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces ConnectionLogContext to carry per-connection logging identity and thresholds across threads without colliding with user or library log parameters. It updates BigQueryJdbcResultSetLogger, BigQueryJdbcRootLogger, OpenTelemetryJulHandler, and PerConnectionFileHandler to utilize this new context instead of a raw connection ID string. Feedback is provided regarding the hasPositionalPlaceholder method in OpenTelemetryJulHandler, which currently only supports single-digit placeholders (0-9) and can be optimized to a single-pass scan to handle multi-digit placeholders more efficiently.

@Neenu1995
Neenu1995 added this pull request to stack #15256 November 26, 2026 20:52
@Neenu1995
Neenu1995 force-pushed the fix/bq-jdbc-connection-log-context branch from 49fab70 to ed72ecd Compare November 26, 2026 21:02
@Neenu1995
Neenu1995 force-pushed the fix/bq-jdbc-connection-log-context branch from ed72ecd to 52761ec Compare November 27, 2026 00:51
@Neenu1995 Neenu1995 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 27, 2026
@Neenu1995
Neenu1995 force-pushed the fix/bq-jdbc-connection-log-context branch 2 times, most recently from a5fa9a6 to f37d6f5 Compare November 27, 2026 22:55
@Neenu1995
Neenu1995 enabled stacked auto-merge (squash) November 28, 2026 00:34
stacked auto-merge was automatically disabled November 28, 2026 00:56

Auto-merge was disabled for another pull request in the stack

@Neenu1995
Neenu1995 force-pushed the fix/bq-jdbc-connection-log-context branch 2 times, most recently from dca6d80 to 6967500 Compare November 28, 2026 01:17
Base automatically changed from fix/bq-jdbc-log-rotation-and-context to main November 28, 2026 01:55
@Neenu1995
Neenu1995 force-pushed the fix/bq-jdbc-connection-log-context branch from 6967500 to 9e9d5b8 Compare November 28, 2026 01:55
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 28, 2026
@Neenu1995
Neenu1995 merged commit 718e941 into main Nov 28, 2026
195 checks passed
@Neenu1995
Neenu1995 deleted the fix/bq-jdbc-connection-log-context branch November 28, 2026 02:27
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.

3 participants