Message-ID: From: "mschorsch (@mschorsch)" To: "pgjdbc/pgjdbc" Date: Sat, 18 Oct 2025 07:51:08 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3835: Virtual Thread pinned in PostgreSQL JDBC Driver 42.7.8 In-Reply-To: References: List-Id: X-GitHub-Author-Login: mschorsch X-GitHub-Comment-Id: 3417956530 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3835 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3835#issuecomment-3417956530 Content-Type: text/plain; charset=utf-8 Hi @vlsi, sorry for the late reply. > Do you have a reproducer for the issue? I do not have a reproducer. We were only able to find the problem in production. > QueryExecutorBase.getStandardConformingStrings acquires a connection-scoped lock, so if you got pinning, then it looks like the same connection was used in a different thread which looks like an anti-pattern. Thanks for the hint. We will check that again. > In any case, it makes sense to move createAction.create() out of the synchronized block, however, I believe it will just mask the true issue of "sharing the same connection between concurrent execute threads" which you probably need to address in the app. 👍