You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b27385e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(bigquery-jdbc): use one logger per class to stop child-logger registration leak (#14716)
b/576218509
- Replace the per-instance `LOG = new
BigQueryJdbcCustomLogger(this.toString())`
field with one `static final` logger per class in `BigQueryStatement`,
`BigQueryConnection`, `BigQueryDatabaseMetaData`,
`BigQueryCallableStatement`,
`BigQueryPooledConnection` (+ `BigQueryPooledConnectionWrapper`),
`PooledConnectionListener`, and `DataSource`. Each logger is named after
its
own class so the `CLASS` column fallback in the formatter stays correct.
- Remove the duplicate `setParent(...)` call in the 1-arg
`BigQueryJdbcCustomLogger` constructor; the 2-arg constructor it
delegates to
already sets the parent. The second call forced a full scan of the
parent's
child list under the global `treeLock` on every construction.
- Add regression tests to `BigQueryJdbcCustomLoggerTest`:
- `testLoggerIsParentedToDriverRootLogger` locks in that every logger is
still parented to the driver root logger (handlers/levels keep flowing).
- `testCreatingStatementsDoesNotRegisterChildLoggers` and
`testCreatingDatabaseMetaDataDoesNotRegisterChildLoggers` construct
1,000
objects and assert the root logger's child count does not grow. Both
fail
on `main` and pass with this change.
- Add `--add-opens=java.logging/java.util.logging=ALL-UNNAMED` to the
surefire
`argLine` (test-only) so the regression tests can read the JDK-internal
child-logger list on JDK 17+.
No behavior change to per-connection log files or formatting: routing
and the
`[CONNECTION_ID]` column come from the MDC / record parameters, not from
the
logger name.
0 commit comments