Skip to content

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

Open
Neenu1995 wants to merge 1 commit into
fix/bq-jdbc-log-rotation-and-contextfrom
fix/bq-jdbc-connection-log-context
Open

Neenu1995 wants to merge 1 commit into
fix/bq-jdbc-log-rotation-and-contextfrom
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 from 52761ec to a5fa9a6 Compare November 27, 2026 16:11

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run Add this label to force Kokoro to re-run the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants