On Fri, Nov 7, 2025 at 9:07 AM Chao Li <[email protected]> wrote:
> If you put this explanation to the inline comment, things would get clearer. 
> But based on this explanation, I just got the other doubt. When a pipeline is 
> aborted, res is NULL, but we still stay in the for loop, PQClear(res) will do 
> nothing, then the “for” loop is similar to an empty loop, would that lead to 
> a high CPU usage? From this perspective, when pipeline is aborted, while 
> waiting for PIPELINE_SYNC, adding a tiny sleep might be better.

You're concerned about cases where the server response is delayed,
causing the pipeline status to take time to reach PIPELINE_SYNC, right?
In that situation, since discardAvailableResults() waits on PQgetResult(),
it shouldn't enter a busy loop, correct?


> I will back to work next Monday, then I will try to run a test and reproduce 
> the scenario of pipeline abort.

I plan to commit the patch soon, but let's keep discussing and
investigating the case you mentioned afterward!

Regards,

-- 
Fujii Masao


Reply via email to