Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2ed391f

Browse files
committed
Fix pgbench options -C and -R together
The bug is that prior to --rate doCustom was always disconnect/reconnect without exiting, but with rate it returns if it has to wait. However threadRun test whether there is a connection before recalling doCustom, so it was never called. Bug is not existed in head branch because of refactoring at 12788ae, patch only 9.6 Author: Fabien Coelho Reviewed-by: me https://commitfest.postgresql.org/13/970/
1 parent 8de6278 commit 2ed391f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bin/pgbench/pgbench.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,6 @@ doCustom(TState *thread, CState *st, StatsData *agg)
19671967
st->listen = false;
19681968
st->sleeping = false;
19691969
st->throttling = false;
1970-
st->is_throttled = false;
19711970
memset(st->prepared, 0, sizeof(st->prepared));
19721971
}
19731972

@@ -4345,6 +4344,12 @@ threadRun(void *arg)
43454344
remains--; /* I've aborted */
43464345
}
43474346
}
4347+
else if (is_connect && st->sleeping)
4348+
{
4349+
/* it is sleeping for throttling, maybe it is done, let us try */
4350+
if (!doCustom(thread, st, &aggs))
4351+
remains--;
4352+
}
43484353

43494354
if (st->ecnt > prev_ecnt && commands[st->state]->type == META_COMMAND)
43504355
{

0 commit comments

Comments
 (0)