pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: martin-dorey-hv (@martin-dorey-hv) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] issue #3953: "ForkJoinPool.commonPool-worker-1" java.lang.SecurityException: setContextClassLoader
Date: Sat, 07 Mar 2026 04:23:55 +0000
Message-ID: <[email protected]> (raw)
**Describe the issue**
I'm experiencing exceptions which I'm confident are a regression in the driver.
**Driver Version?**
42.7.10
**Java Version?**
openjdk version "1.8.0_472"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_472-b08)
OpenJDK 64-Bit Server VM (Temurin)(build 25.472-b08, mixed mode)
**OS Version?**
CentOS Stream release 9
**PostgreSQL Version?**
18.3
**To Reproduce**
I'm afraid that I don't know how this big hairy application that I didn't write is using PostgreSQL or the driver. I was tasked with upgrading both components.
**Expected behaviour**
Before the upgrades, when the driver was 42.7.8 and PostgreSQL was 18.1, the exceptions did not happen. When the driver is reverted to 42.7.8 and PostgreSQL kept at 18.3, the exceptions stop.
**Logs**
```
Exception in thread "ForkJoinPool.commonPool-worker-1" java.lang.SecurityException: setContextClassLoader
at java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread.setContextClassLoader(ForkJoinWorkerThread.java:255)
at org.postgresql.util.LazyCleanerImpl.lambda$startThread$0(LazyCleanerImpl.java:181)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
```
The driver's source line from that stack trace is:
https://github.com/pgjdbc/pgjdbc/blame/master/pgjdbc/src/main/java/org/postgresql/util/LazyCleanerIm...
... which was new three months ago under:
https://github.com/pgjdbc/pgjdbc/commit/bdd930bf4
... which is in the list of changes for 42.7.9:
https://jdbc.postgresql.org/changelogs/2026-01-15-42/
Before that change, the call to setContextClassLoader wasn't done on a ForkJoinPool thread.
I got no matches searching for issues with setContextClassLoader and figured it'd be better to have a weak report of a regression than no report. But sorry nonetheless.
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] issue #3953: "ForkJoinPool.commonPool-worker-1" java.lang.SecurityException: setContextClassLoader
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