pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: mschorsch (@mschorsch) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] issue #3835: Virtual Thread pinned in PostgreSQL JDBC Driver 42.7.8
Date: Tue, 30 Sep 2025 14:58:13 +0000
Message-ID: <[email protected]> (raw)

Thread pinning occurs in the Postgres JDBC driver and has been occurring since version [42.7.8](https://github.com/pgjdbc/pgjdbc/releases/tag/REL42.7.8); previous versions were fine.

We suspect that this change is causing the problem: https://github.com/pgjdbc/pgjdbc/pull/3703

```
VirtualThread[#81,quarkus-virtual-thread-14]/runnable@ForkJoinPool-1-worker-3 reason:MONITOR
    java.base/java.lang.VirtualThread$VThreadContinuation.onPinned(VirtualThread.java:199)
    java.base/jdk.internal.vm.Continuation.onPinned0(Continuation.java:393)
    java.base/java.lang.VirtualThread.park(VirtualThread.java:596)
    java.base/java.lang.System$2.parkVirtualThread(System.java:2643)
    java.base/jdk.internal.misc.VirtualThreads.park(VirtualThreads.java:54)
    java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:219)
    java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:754)
    java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:990)
    java.base/java.util.concurrent.locks.ReentrantLock$Sync.lock(ReentrantLock.java:153)
    java.base/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:322)
    org.postgresql.jdbc.ResourceLock.obtain(ResourceLock.java:28)
    org.postgresql.core.QueryExecutorBase.getStandardConformingStrings(QueryExecutorBase.java:302)
    org.postgresql.core.CachedQueryCreateAction.create(CachedQueryCreateAction.java:43)
    org.postgresql.core.CachedQueryCreateAction.create(CachedQueryCreateAction.java:19)
    org.postgresql.util.LruCache.borrow(LruCache.java:130) <== monitors:1
    org.postgresql.core.QueryExecutorBase.borrowQuery(QueryExecutorBase.java:335)
    org.postgresql.jdbc.PgConnection.borrowQuery(PgConnection.java:228)
    org.postgresql.jdbc.PgPreparedStatement.<init>(PgPreparedStatement.java:93)
    org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1426)
    org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1878)
    org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:541)
    io.agroal.pool.wrapper.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:649)
    org.jooq.impl.ProviderEnabledConnection.prepareStatement(ProviderEnabledConnection.java:109)
    org.jooq.impl.SettingsEnabledConnection.prepareStatement(SettingsEnabledConnection.java:91)
    org.jooq.impl.AbstractResultQuery.prepare(AbstractResultQuery.java:189)
    org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:316)
    org.jooq.impl.AbstractResultQuery.fetch(AbstractResultQuery.java:263)
    org.jooq.impl.SelectImpl.fetch(SelectImpl.java:3217)
    com.example.database.client.DSLContextExtensionsKt$fetchAwait$2.invokeSuspend(DSLContextExtensions.kt:39)
    kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
    io.quarkus.virtual.threads.ContextPreservingExecutorService$ContextPreservingRunnable.run(ContextPreservingExecutorService.java:50)
    java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314)
    java.base/java.lang.VirtualThread.run(VirtualThread.java:329)
```

see also https://github.com/quarkusio/quarkus/issues/50345

view thread (7+ 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 #3835: Virtual Thread pinned in PostgreSQL JDBC Driver 42.7.8
  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