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 D47684C889; Thu, 14 Jan 2021 12:09:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D47684C889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610615391; bh=Dqx/30lYYEANgWlrVMPYB/xVyQ31X3IHufZcd84cLMU=; 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=LCAk5lV6q40lFfUCiELBy0lwFynhW0TeXLuD2+Eyj1IY2s8CvVitDRm2Pnv/zHGrX jVwxxOlw3UBDTI6gL1XD5RZoR/DAEXD6cfNGGXsb2+8TQhYuuqWvZvVaIfex3RGS1B 8iOyfE4fVo3JZavI0ipy+dgnjHYHH8ClpXfrzcCc= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 6B9AA4C885 for ; Thu, 14 Jan 2021 12:09:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6B9AA4C885 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1kzydZ-0007Un-G9; Thu, 14 Jan 2021 12:09:49 +0300 To: sergeyb@tarantool.org, tarantool-patches@dev.tarantool.org Cc: alexander.turenko@tarantool.org References: <21efa7345344e8ecbe09d2b55e33f876d30b65cd.1610526975.git.estetus@gmail.com> Message-ID: <65291d86-7476-06a6-49ad-99bb15cbd3f1@tarantool.org> Date: Thu, 14 Jan 2021 12:09:34 +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: <21efa7345344e8ecbe09d2b55e33f876d30b65cd.1610526975.git.estetus@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD3008320BFA2F4C653BABCE9B72A1DEA600894C459B0CD1B9CF705CA724D7F180E61EABC429F205181941F1756450D2593B74FEA2CA3DCB6F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F5F08398AF01CA1FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006373C710FAF3667BB888638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC0C6E0E68801B4CDCFB26B287DE638DE52E6146A4320A90B4389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0ECC8AC47CD0EDEFF8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C098EC00D919C1E4B67B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050F0AC5B80A05675ACD1B0CC92B5A49C88EB3661434B16C20AC78D18283394535A975ECD9A6C639B01BC09775C1D3CA48CFAA8C68A3574AB3B435872C767BF85DA22EF20D2F80756B5F40A5AABA2AD3711975ECD9A6C639B01B78DA827A17800CE760822658196F8C5A731C566533BA786A40A5AABA2AD371193C9F3DD0FB1AF5EB82E77451A5C57BD33C9F3DD0FB1AF5EB4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5AD23F620F5B003FE5A7805C7BB06C2384FE21741DE8603FDD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758F9E841AEAEC4F2C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AA13E2DDB9067862C19E75BFA3B32763C89BA86339B571EAD663560DD394B4C257BD5B0C24A244791D7E09C32AA3244CAD000FF9C5C91378D7B52AC6A3B70E0B5595C85A795C7BAEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9kdO2HH36x489IeSZR+93A== X-Mailru-Sender: 48EFD2E18A91C559803250E574CC3D2968D37494A710F70F4563712C995868E46CCF71F689FD47EED35D514C7DAC97282D063C67CFD4E84987597EC79699C0E6F21BD4036121A32F7402F9BA4338D657ED14614B50AE0675 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: Leonid Vasiliev via Tarantool-patches Reply-To: Leonid Vasiliev Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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. 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) > >