Re: Suggestion to add --continue-client-on-abort option to pgbench

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Rintaro Ikeda <ikedarintarof(at)oss(dot)nttdata(dot)com>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "slpmcf(at)gmail(dot)com" <slpmcf(at)gmail(dot)com>, "boekewurm+postgres(at)gmail(dot)com" <boekewurm+postgres(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: Suggestion to add --continue-client-on-abort option to pgbench
Date: 2025-11-07 09:33:17
Message-ID: CAHGQGwEG4zTBPr+R8+Xi7k8d8GR77xDNGSW0H8fG49E9dZLiaQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 7, 2025 at 9:07 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-11-07 09:38:45 Re: Reorganize GUC structs
Previous Message shveta malik 2025-11-07 09:23:55 Re: Logical Replication of sequences