Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, vdavydov@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] coio: handle spurious wakeup correctly
Date: Wed, 17 Nov 2021 10:33:42 +0300	[thread overview]
Message-ID: <1046a3bb-cda1-f64a-d172-71e0022895a6@tarantool.org> (raw)
In-Reply-To: <07bdcdec-8dbc-35f2-6b76-b5a432f97441@tarantool.org>



17.11.2021 01:49, Vladislav Shpilevoy пишет:
> Hi! Thanks for the patch!

Thanks for your answer!

>
> On 16.11.2021 11:17, Serge Petrenko via Tarantool-patches wrote:
>> coio_accept, coio_read, coio_write, coio_writev used to handle spurious
>> wakeups correctly: if the timeout hasn't passed yet, they would simply
>> retry reading (or writing) and fall asleep once again if no data is
>> ready.
>>
>> This behaviour changed in the following patches:
>> 577a640a7fdec986d19101ed04d2afa80e951c78 ("coio: pass fd to
>> coio_accept") and 4f84859dcdd6126b0bdcda810b7f5f58386bdac6 ("Introduce
>> iostream wrapper for socket I/O").
>>
>> Now the functions timeout on the very first spurious wakeup.
>>
>> Fix this, add the appropriate unit tests and a test_iostream
>> implementation for the ease of testing.
> Don't we have the same problem with coio_connect_addr() (used in
> coio_connect_timeout())?
Not really. Neither coio_connect_addr() nor coio_connect_timeout() retry
the connection. So even the previous version would throw an error after
a spurious wakeup. Just the error would be different.
Before the change it would throw SocketError, not TimedOut, but I don't 
think
this matters much. Does it?

By the change I mean (2db0741b) "coio: return fd from coio_connect".

-- 
Serge Petrenko


  reply	other threads:[~2021-11-17  7:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 10:17 Serge Petrenko via Tarantool-patches
2021-11-16 11:29 ` Vladimir Davydov via Tarantool-patches
2021-11-16 11:36   ` Serge Petrenko via Tarantool-patches
2021-11-16 22:49 ` Vladislav Shpilevoy via Tarantool-patches
2021-11-17  7:33   ` Serge Petrenko via Tarantool-patches [this message]
2021-11-17 23:11     ` Vladislav Shpilevoy via Tarantool-patches
2021-11-19 10:30       ` Serge Petrenko via Tarantool-patches
2021-11-21 14:24         ` Vladislav Shpilevoy via Tarantool-patches
2021-11-22  6:47           ` Serge Petrenko via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1046a3bb-cda1-f64a-d172-71e0022895a6@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --cc=vdavydov@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] coio: handle spurious wakeup correctly' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox