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 0A8F964672; Wed, 13 Jan 2021 11:50:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0A8F964672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610527820; bh=GwiMyF6/7LRub11mEFapp7X/8wf4nb7TXRwpLIW0Xkg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ArPXRWHj2Gei7xt0GPS9rfDkpzeQLPDQ5pfEy6xlLnzJdaPCaEGEyc+vyQhf0Iptn yWz6ZEgs5AFbPrcx0ItndNbMjys76H7vk3X8kUxKX4irwnokTsGL2n3qqEDFQwhmxE R1bs00fePo6tIRYZczd9u1E04IatLicFbZU3rfaw= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 DA4784C88D for ; Wed, 13 Jan 2021 11:49:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DA4784C88D Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1kzbpz-0007V2-Qb; Wed, 13 Jan 2021 11:49:08 +0300 To: tarantool-patches@dev.tarantool.org, lvasiliev@tarantool.org Date: Wed, 13 Jan 2021 11:48:34 +0300 Message-Id: <21efa7345344e8ecbe09d2b55e33f876d30b65cd.1610526975.git.estetus@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CDC332107C56D78A30EABAEB9DEE13ADFC00894C459B0CD1B9C822ADB01E65C196EFC5A3EF4842C9C254F7F300FA7FCDDC3079A20884B034D2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70240200614025CBBC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7904AD829351C4442EA1F7E6F0F101C674E70A05D1297E1BBC6CDE5D1141D2B1CDDB20C1CDBDA2CD930870A1C8933DEBFD5287F9C18BA7F319FA2833FD35BB23D9E625A9149C048EEB1593CA6EC85F86D618001F51B5FD3F9D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B1F8789D36234D406A471835C12D1D977C4224003CC836476EC64975D915A344093EC92FD9297F6718AA50765F79006372C56F9BC9525AE6AA7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89FC0F9454058DFE53CC6EABA9B74D0DA47B5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DBCF17F1EDFBC1FB573B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CD9CBB3A052EDBDE5729A242AD0716FC77D94915AD74BD5DB9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF6EA1BA7CA28B4A74699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343C45ADCD169245FA9350E65DE4441EA290B9FF29A1FCA6852BDD6D06B366D5380B13E45CE89293A51D7E09C32AA3244C9CA23E0BE130B937BD85EA927F5034255A1673A01BA68E40927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4exXbGs3yZpLGwH4JSl4VA== X-Mailru-Sender: 689FA8AB762F73937240DDB2502DDB700AFBC238ADD5B8C390E26033EE26E2A8DD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [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: sergeyb@tarantool.org Cc: alexander.turenko@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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) -- 2.25.1