Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Sat, 14 Mar 2026 06:45:06 +0000 Subject: [pgjdbc/pgjdbc] PR #3962: fix: catch SecurityException from setContextClassLoader on ForkJoinPool workers List-Id: X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Issue: 3962 X-GitHub-Labels: bug, building-and-testing X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3962 Content-Type: text/plain; charset=utf-8 `InnocuousForkJoinWorkerThread` (used by `ForkJoinPool.commonPool()` under certain security configurations) throws `SecurityException` when `setContextClassLoader` is called. This crashed the cleanup thread, disabling phantom-reference-based leak detection for the rest of the JVM lifetime. Wrap the call in try-catch since it is best-effort: `ForkJoinPool` does not inherit `contextClassLoader` from the submitting thread, but custom thread factories might, so we still attempt to nullify it. Fixes https://github.com/pgjdbc/pgjdbc/issues/3953