I have applied your patches plus an fprintf to see if PQisBusy()
actually returns true. Then ran pgbench with -c 128 -t 100. So far I
could not see any evidence that PQisBusy() returns true.
> I think pgbench is not dealing with asynchronous input quite right.
> As written, if the backend sends a response that doesn't fit into
> a single TCP packet, pgbench will go into a tight loop of
> PQisBusy/PQconsumeInput, which will not exit until the rest of the
> response arrives. This would degrade the reported performance, first
> because of the wasted CPU cycles, and second because other connections
> wouldn't get serviced during that interval.
> I haven't done enough tests to be sure that that isn't just a chance
> variation, but I recommend changing the code as below anyway.
Ok, I will commit your changes. Thanks.
--
Tatsuo Ishii