Re: timeout value overflow in wait for lsn - Mailing list pgsql-hackers

From cca5507
Subject Re: timeout value overflow in wait for lsn
Date
Msg-id tencent_F49415993E3CAA832ABB9C5088C2DFDAF807@qq.com
Whole thread
In response to Re: timeout value overflow in wait for lsn  (Xuneng Zhou <xunengzhou@gmail.com>)
Responses Re: [PATCH v2] Avoid internal error for invalid interval typmods
List pgsql-hackers
> --- The divergence
> Rounding like this does not make a lot of sense to me in the first
> place, especially when the value rounded down to is zero, which
> disables the timeout in lots of places. I don't know whether users
> have ever been surprised by this behavior and why it was designed like
> this. One reason for this seems to be that the value is small enough
> to do so.
>
> The general GUC doc says:
> fractional values are rounded to the nearest integer if the parameter
> is of integer type.
> If a fractional value is specified with a unit, it will be rounded to
> a multiple of the next smaller unit if there is one.
>
> However, the individual statement_timeout and lock_timeout
> descriptions do not clearly warn that a nonzero or negative spelling
> can round to zero and consequently disable the timeout. They only
> state that zero disables it.
>
> I am wondering whether the timeout in WAIT FOR needs to take a
> different path since it is not constrained with backward
> compatibility.

How about just keeping it consistent with GUC: use parse_int() and
error out if timeout < 0. I didn't see users complaining about this
behavior.

--
Regards,
ChangAo Chen

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Re-read conindid under the referenced table's lock in the RI fast path
Next
From: Matthias van de Meent
Date:
Subject: Re: Commit Sequence Numbers and Visibility