Skip to content

feat(bqjdbc): implement Per connection logging with Context proxy#13001

Merged
Neenu1995 merged 17 commits intomainfrom
ns/per-con-log-alt
May 6, 2026
Merged

feat(bqjdbc): implement Per connection logging with Context proxy#13001
Neenu1995 merged 17 commits intomainfrom
ns/per-con-log-alt

Conversation

@Neenu1995
Copy link
Copy Markdown
Contributor

@Neenu1995 Neenu1995 commented May 5, 2026

b/501081433

  1. Foundational MDC & Global File Handler Routing
    Simplifies the BigQueryJdbcMdc ThreadLocal context slots, sets up "Jdbc-global" fallback file routing, and adds isFileLoggingEnabled() to the root logger.

  2. Dynamic Context Proxy Wrapper & Connection Wrap
    Implements the BigQueryJdbcContextProxy dynamic proxy interceptor, delegating standard wrappers, and wrapping all new JDBC entries in BigQueryDriver.

  3. Statement Modifications & Connection Pool unwrapping
    Adapts Statements and Connection ID builders to utilize the dynamic proxy, and updates connection pool managers to safely extract raw connection properties via standard unwrap calls.

  4. 0%-Overhead Raw ResultSet & Metadata Routing
    Completely un-proxies ResultSet to achieve 0% query execution overhead, while implementing targeted ResultSetMetaData proxy wrapping inside getMetaData() to keep metadata queries connection-routed.

  5. Decoupled Exceptions & Clean Integration Tests
    Decouples all custom exception constructors to eliminate double-logging, converts all 17 integration test class casts to standard unwrap calls, and migrates all deprecated github_timeline public dataset queries to the active shakespeare dataset.

@Neenu1995 Neenu1995 requested review from a team as code owners May 5, 2026 01:33
Copy link
Copy Markdown
Contributor

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

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 a dynamic proxy mechanism, BigQueryJdbcContextProxy, to automate the management of connection-specific logging contexts (MDC) and unify exception logging across JDBC components. It simplifies the BigQueryJdbcMdc implementation and refactors various classes to remove manual logging overhead. Review feedback suggests extending the proxy to ResultSet to maintain context during data retrieval, handling Object methods within the proxy, correcting the isWrapperFor logic, and improving null-safety in exception message logging.

@Neenu1995 Neenu1995 requested a review from logachev May 5, 2026 18:28
@Neenu1995 Neenu1995 merged commit 293f18f into main May 6, 2026
147 of 151 checks passed
@Neenu1995 Neenu1995 deleted the ns/per-con-log-alt branch May 6, 2026 16:02
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.

2 participants