Re: pgbench bug candidate: negative "initial connection time" - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench bug candidate: negative "initial connection time"
Date
Msg-id alpine.DEB.2.22.394.2106171149410.2693553@pseudo
Whole thread Raw
In response to Re: pgbench bug candidate: negative "initial connection time"  (Yugo NAGATA <nagata@sraoss.co.jp>)
Responses Re: pgbench bug candidate: negative "initial connection time"
List pgsql-hackers
>> Second, currently the *only* function to change the client state is
>> advanceConnectionState, so it can be checked there and any bug is only
>> there. We had issues before when several functions where doing updates,
>> and it was a mess to understand what was going on. I really want that it
>> stays that way, so I disagree with setting the state to ABORTED from
>> threadRun. Moreover I do not see that it brings a feature, so ISTM that it
>> is not an actual issue not to do it?
>
> Ok. I gave up to change the state in threadRun. Instead, I changed the
> condition at the end of bench, which enables to report abortion due to
> socket errors.
>
> +@@ -6480,7 +6490,7 @@ main(int argc, char **argv)
> + #endif                            /* ENABLE_THREAD_SAFETY */
> +
> +         for (int j = 0; j < thread->nstate; j++)
> +-            if (thread->state[j].state == CSTATE_ABORTED)
> ++            if (thread->state[j].state != CSTATE_FINISHED)
> +                 exit_code = 2;
> +
> +         /* aggregate thread level stats */
>
> Does this make sense?

Yes, definitely.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Less compiler errors in pg_crc32c_sse42_choose.c
Next
From: "osumi.takamichi@fujitsu.com"
Date:
Subject: RE: Fix for segfault in logical replication on master