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 02A8B4C885; Thu, 14 Jan 2021 12:57:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 02A8B4C885 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610618243; bh=T3h5NCzZBSiSe5GvIOu3RHD4fXZ+xrczG0phmrcGxeo=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=uHaFozIZ9RhsCHAwW7uixtJUjzt3qIrtmWXkgDj1R9IG9E1nAb8URxXRR1hVOkDRb Ye9PANsMLnADY6SaBv9ZAjhg+Cu2lRgLJJk9o3XAKfUIlNjXpAvlhnskTllDuOYd7t Fc1rHxDp+NMiJONrH4ItJLkyE07LdWPPtYfyTPWM= Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (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 371EA4C885 for ; Thu, 14 Jan 2021 12:57:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 371EA4C885 Received: by smtp33.i.mail.ru with esmtpa (envelope-from ) id 1kzzNZ-0005bB-D2; Thu, 14 Jan 2021 12:57:21 +0300 To: Leonid Vasiliev , tarantool-patches@dev.tarantool.org Cc: alexander.turenko@tarantool.org References: <21efa7345344e8ecbe09d2b55e33f876d30b65cd.1610526975.git.estetus@gmail.com> <65291d86-7476-06a6-49ad-99bb15cbd3f1@tarantool.org> Message-ID: <494197e4-fb8c-f4f6-d2c9-9fe129ebfaa0@tarantool.org> Date: Thu, 14 Jan 2021 12:57:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <65291d86-7476-06a6-49ad-99bb15cbd3f1@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD3BE40D5FE7B3134676ED03235248932300894C459B0CD1B98EA1A99C3FA7C1B5DAFFF70C83E3D94066E7B4652A93C96471713673A8881951 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7952C4D7BD0BF3359EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063707C1E244DAE02CF68638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC20F4D7051A80631818BC46318A147503A3625D31092C748C389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B652D31B9D28593E51CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249E444A4296FBB38C076E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8BA590733F876D84DF3AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE70012B0FBE38D23AE67F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C3EB868C3EEB441C6B35872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C938130EB80001CEACE5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5515603C78E2CA51845CD7D44AD62FAF900136D72DD647991D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758F9E841AEAEC4F2C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3467D08F30473A5842AB52BF467ECDE58EF555CB903ED43016A26F7C7A1F741C5BF976E06FB3BAA3031D7E09C32AA3244C4C2DF9BD295882C6F2C776CFB21FBA3497FE24653F78E668FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9kdO2HH36x7OXKdY6DL1YQ== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F258845839B83478A8D8E60374E8280BC247BB6364CA3E16C239DCF9282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 3/4] test: enable SO_REUSEADDR on socket in httpd.py 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: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for review! On 14.01.2021 12:09, Leonid Vasiliev wrote: > Hi! Thank you for the patch. > LGTM. > > This is a popular technique. > But I don't understand:"Why is it needed when python3 is used, but not > needed for python2?" If you know, share with me, if not, let it remain a > mystery. Last two commits are not related to python 3 support and I didn't state it. These patches are useful changes that I decided to add to the series. > > On 13.01.2021 11:48, sergeyb@tarantool.org wrote: >> From: Sergey Bronnikov >> >> TL;DR httpd.py warns that port is busy when restart server. With socket >> option SO_REUSEADDR it allows to restart httpd.py without problem. >> >> Socket option SO_REUSEADDR tells the kernel that even if this port is >> busy, go ahead and reuse it anyway. If it is busy, but with another >> state, you will still get an address already in use error. It is useful >> if your server has been shut down, and then restarted right away while >> sockets are still active on its port. >> --- >>   test/app-tap/httpd.py | 1 + >>   1 file changed, 1 insertion(+) >> >> diff --git a/test/app-tap/httpd.py b/test/app-tap/httpd.py >> index 62435e91a..60084bdbf 100755 >> --- a/test/app-tap/httpd.py >> +++ b/test/app-tap/httpd.py >> @@ -138,6 +138,7 @@ else: >>       usage() >>     sock = socket.socket(sock_family, socket.SOCK_STREAM) >> +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) >>   sock.bind(sock_addr) >>   sock.listen(10) >>