Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru> writes:

> On 02.10.24 16:49, Markus Armbruster wrote:
>> Eric Blake <ebl...@redhat.com> writes:
>> 
>>> Although defaulting the handshake limit to 10 seconds was a nice QoI
>>> change to weed out intentionally slow clients, it can interfere with
>>> integration testing done with manual NBD_OPT commands over 'nbdsh
>>> --opt-mode'.  Expose a QMP knob 'handshake-max-secs' to allow the user
>>> to alter the timeout away from the default.
>>>
>>> The parameter name here intentionally matches the spelling of the
>>> constant added in commit fb1c2aaa98, and not the command-line spelling
>>> added in the previous patch for qemu-nbd; that's because in QMP,
>>> longer names serve as good self-documentation, and unlike the command
>>> line, machines don't have problems generating longer spellings.
>>>
>>> Signed-off-by: Eric Blake <ebl...@redhat.com>

[...]

>> Are we confident we'll never need less than a full second?
>
> Hmm, recent "[PATCH v2] chardev: introduce 'reconnect-ms' and deprecate 
> 'reconnect'" shows that at least sometimes second is not enough precision.
>
> Maybe, using milliseconds consistently for all relatively short time 
> intervals in QAPI would be a good rule?

Ideally, we'd use a single unit for time: nanoseconds.  But we missed
that chance long ago, and now are stuck with a mix of seconds,
milliseconds, microseconds, and nanoseconds.

I think a good rule is to pick the first from this list that will surely
provide all the precision we'll ever need.

In this case, milliseconds should do.


Reply via email to