Repository navigation
fix(bigquery-jdbc): propagate proxy and SSL TrustStore settings to Clearcut transport - #15396
keshavdandeva wants to merge 7 commits into
Conversation
…metry initialization
…uting and failure isolation
… and failed-connect isolation
…port and batcher tests
…replacement, and transport shutdown
There was a problem hiding this comment.
Code Review
This pull request introduces transport-profile isolation and lifecycle management for diagnostic telemetry in the BigQuery JDBC driver. It adds support for tracking connection-specific proxy and SSL TrustStore configurations, generating unique transport profile keys, and managing provisional telemetry managers to prevent conflicts. The review feedback highlights three main improvement opportunities: adding defensive null checks in computeTransportProfileKey to prevent a potential NullPointerException if proxyProperties or its values are null, using a loop in TelemetryManager.initializeForConnection to re-evaluate concurrent updates to the active instance to avoid redundant telemetry manager creation, and adding a defensive null check in shutdownTransportQuietly to prevent a NullPointerException if httpTransport is null.
Stacked on #15395.
Summary
Propagates JDBC proxy and SSL TrustStore settings to the Clearcut diagnostic telemetry HTTP transport, shuts down Clearcut's owned
HttpTransporton teardown, and enforces transport-profile isolation across established connections without letting failed connects disable healthy telemetry.Key changes
BigQueryJdbcProxyUtility: Consolidates proxy validation into a shared helper (tryParseProxyProperties) and addscreateCustomHttpTransport(...)to construct a dedicatedHttpTransportwith the connection's proxy and SSL TrustStore settings.BigQueryJdbcDiagnosticTelemetry&BigQueryConnection: Passes parsed proxy properties into telemetry initialization, computes a normalized SHA-256 transport profile key from active proxy and TrustStore settings, supplies a customHttpTransportonly when proxy or TrustStore settings are active, and guards failed-connection paths so invalid or raw-URI proxy/TrustStore configurations never fall back to a direct transport.ClearcutTransport,TelemetryBatcher,TelemetryManager: Always owns and shuts down itsHttpTransporton close or setup failure, reuses the active manager for matching profiles, disables telemetry globally without flushing when two established connections conflict on transport profile, and marks failed-first-connect managers asprovisionalso the first established connection can promote or replace them.Decisions made
HttpTransport: Direct connections pass anulltransport supplier (TelemetryManagerconstructs its ownNetHttpTransport) and proxied/custom-TLS connections receive a dedicatedApache5HttpTransport, removing the need for an ownership flag.SSLTrustStoreor mismatched transport profile skips recording instead of latching the global kill switch, while an explicit opt-out or suppressed universe still disables globally.KeyStoretype avoids spurious conflicts while avoiding plaintext retention of proxy or TrustStore passwords in memory.TelemetryManageris a JVM-wide singleton, conflicting transport profiles across established connections disable diagnostic telemetry rather than sending traffic over the wrong proxy or TrustStore.