From: davecramer (@davecramer) <noreply+davecramer@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4331: fix(copy): keep the COPY active when a read times out
Date: Thu, 05 Nov 2026 11:21:10 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4331-rc4479797851@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4331@github.com>
References: <gh-pgjdbc-pgjdbc-4331@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java:301)
There are two locks here: threads in `waitOnLock()` do hold `lock`, because `Condition.await` requires it. What they do not take is the COPY lock, `lockedFor`. Naming it would avoid the second reading, for example "Threads that return from waitOnLock() do not take the COPY lock, so ...".