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 B9FA36E459; Thu, 18 Nov 2021 02:11:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B9FA36E459 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1637190673; bh=6cmd9z+z5E7Ry3g85lT2/e7Gv1vxkwmpo30z7wMLQ5g=; 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=WTEuf/JAXSDQAngIzs+x1BpeUN2dQLFZV3G25LnVYkYGM4FNAm+CVSEscP19AfyK8 kAlxFURqgVHFkKQ0BoaAEgluZrx2r+HgNd8WdSuXH4YCiojH8ATMEiDzRDIPQ35ihb YmKS68U5ZZ0tURGjewR+EilLIozzYXPFraqgml/o= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 EC29C6E459 for ; Thu, 18 Nov 2021 02:11:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EC29C6E459 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1mnU58-0002GB-Rs; Thu, 18 Nov 2021 02:11:11 +0300 Message-ID: Date: Thu, 18 Nov 2021 00:11:09 +0100 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-US To: Serge Petrenko , vdavydov@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <20211116101731.48597-1-sergepetrenko@tarantool.org> <07bdcdec-8dbc-35f2-6b76-b5a432f97441@tarantool.org> <1046a3bb-cda1-f64a-d172-71e0022895a6@tarantool.org> In-Reply-To: <1046a3bb-cda1-f64a-d172-71e0022895a6@tarantool.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9731B3922EC063979CAB00300CDA98DC51CCA794E1CC6B18A00894C459B0CD1B9E7FF0E9F4A50B0545468D9FBFE107916DA8FB3F14522F091780541A005FBAD07 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE792C68BF9CD4C0E9EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063719899BAB9B61B3948638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D82B8306E37DD038185295BF76A360D96B117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FE5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505C4815367AB30B837D2BE1CF70BBC8F37 X-C1DE0DAB: 0D63561A33F958A52B1F6E19288E8EE1FB11E94CC5333B55B8D19C3556EB9EA7D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7506FE1F977233B9BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FACF503ACC83041B20CEBC450C436D685C8C83AB4223BD1B5D75E6C892703DDEF720CD453F33F4621D7E09C32AA3244CB1D4C6C322BCA1719A7D279D41C674EDB018FE5BB746DCD1FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj81eoY04PbonVOr7quT4FGA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D19D73FD85C0A06D30AA531BEEACCEFD43841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" >> 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". Ok, then never mind. I will wait for fixes of Vova's comments regarding the tests, but the bugfix itself LGTM.