From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 42F746E459; Wed, 17 Nov 2021 10:33:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 42F746E459 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1637134425; bh=GlavFMoKpDKlmIRYdp9uM57bHqgyHmuYn885Ef5979M=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=JJmkj/+3Be7EAtQbm5QbLLrO36nEuHvn/Ck1Xnxuxapt4OI6QF1T+EKKYsEoSd2T0 I4Sx7oh6MXnz/aQV7QrTsXDVYtmshbYTojDKTcYhkG2RuaOpycxA70mE5V4sjIN8B6 ebdpVYO4ahv8Ytb00deujD/peno7v1gIRCA7uacg= Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0F7936E459 for ; Wed, 17 Nov 2021 10:33:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0F7936E459 Received: by smtp63.i.mail.ru with esmtpa (envelope-from ) id 1mnFRu-0004NF-Pk; Wed, 17 Nov 2021 10:33:43 +0300 Message-ID: <1046a3bb-cda1-f64a-d172-71e0022895a6@tarantool.org> Date: Wed, 17 Nov 2021 10:33:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Content-Language: en-GB To: Vladislav Shpilevoy , vdavydov@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <20211116101731.48597-1-sergepetrenko@tarantool.org> <07bdcdec-8dbc-35f2-6b76-b5a432f97441@tarantool.org> In-Reply-To: <07bdcdec-8dbc-35f2-6b76-b5a432f97441@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9731B3922EC0639792FFC8A1478656943FA9F74D7A497B1C400894C459B0CD1B93262E594D8E9C0F61962B1D7493B07FED4557EA0E117A89E4897834CF495C201 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DECE8D0A5E25C0FCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006379C6642364E0E74208638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8168F27063198F6C57D638515FDAFB79C117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF80095D1E57F4578A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FE5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B65D56369A3576CBA5089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5FE09B1591B06344CCFB79211148F71AA23E4B1B021B705B1D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7506FE1F977233B9BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3452F7993FB7281BFD815AA4677D6A301449E3F798A1BCB1C64F24EE0535583A6C117D1BC320429C0D1D7E09C32AA3244C20BFF921AF37B6E6DF00D7E083DFDE38259227199D06760AFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj81eoY04PbolSjOLhtx80WQ== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A4468A6023139BA941BB830085BE2D4AB739CBCCD57F2E67AF48424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] coio: handle spurious wakeup correctly X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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