Re: [HACKERS] pgbench - minor fix for meta command only scripts - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: [HACKERS] pgbench - minor fix for meta command only scripts
Date
Msg-id CAMkU=1zQaGn7mz7Hz8xNNz7sJDkb5YP=4Xdvff4W0tjy7xTJKA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] pgbench - minor fix for meta command only scripts  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [HACKERS] pgbench - minor fix for meta command only scripts
List pgsql-hackers
On Mon, Sep 11, 2017 at 1:49 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:

Hello Jeff,

Ok, the problem was a little bit more trivial than I thought.

The issue is that under a low rate there may be no transaction in progress, however the wait procedure was relying on select's timeout. If nothing is active there is nothing to wait for, thus it was an active loop in this case...

I've introduced a usleep call in place of select for this particular case. Hopefully this is portable.

Shouldn't we use pg_usleep to ensure portability?  it is defined for front-end code.  But it returns void, so the error check will have to be changed.

I didn't see the problem before the commit I originally indicated , so I don't think it has to be back-patched to before v10.

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] pgbench tap tests & minor fixes.
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] More flexible LDAP auth search filters?