pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] PR #3962: fix: catch SecurityException from setContextClassLoader on ForkJoinPool workers
Date: Sat, 14 Mar 2026 06:45:06 +0000
Message-ID: <[email protected]> (raw)

`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

view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #3962: fix: catch SecurityException from setContextClassLoader on ForkJoinPool workers
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox