-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
-
False
-
-
When using JDBC_PING2 and virtual threads, I see thread pinning. With a small number of CPU cores (1), this leads to issues when there is only one core.
This occurred when investigating a Keycloak upstream issue, see https://github.com/keycloak/keycloak/issues/37162
See below for the "-Djdk.tracePinnedThreads=full" report.
VirtualThread[#189]/runnable@ForkJoinPool-1-worker-2 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:369)
java.base/sun.nio.ch.Poller.pollIndirect(Poller.java:139)
java.base/sun.nio.ch.Poller.poll(Poller.java:102)
java.base/sun.nio.ch.Poller.poll(Poller.java:87)
java.base/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:175)
java.base/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:201)
java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309)
java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099)
org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:192)
org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:159)
org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:144)
org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:76)
org.postgresql.core.PGStream.receiveChar(PGStream.java:476)
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2174)
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517)
org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434)
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)
org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:155)
io.agroal.pool.wrapper.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:90)
org.jgroups.protocols.JDBC_PING2.delete(JDBC_PING2.java:356) <== monitors:1
org.jgroups.protocols.JDBC_PING2.writeToDB(JDBC_PING2.java:177) <== monitors:1
org.jgroups.protocols.JDBC_PING2.write(JDBC_PING2.java:155)
org.jgroups.protocols.FILE_PING.writeAll(FILE_PING.java:318)
org.jgroups.protocols.FILE_PING.writeAll(FILE_PING.java:298)
org.jgroups.protocols.FILE_PING$InfoWriter.run(FILE_PING.java:397)
org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:332)
org.jgroups.util.TimeScheduler3$RecurringTask.run(TimeScheduler3.java:366)
java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314)
java.base/java.lang.VirtualThread.run(VirtualThread.java:329)