From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 35FC62DFFB for ; Tue, 14 May 2019 22:02:59 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qd8g_yEzx4GN for ; Tue, 14 May 2019 22:02:59 -0400 (EDT) Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id EAFFA2DFD8 for ; Tue, 14 May 2019 22:02:58 -0400 (EDT) Date: Wed, 15 May 2019 05:02:57 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/7] swim: do not rebind when new 'port' is 0 Message-ID: <20190515020257.GH3801@atlas> References: <22d5641734c11687a5adf489d7e49dc1de544239.1557875116.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22d5641734c11687a5adf489d7e49dc1de544239.1557875116.git.v.shpilevoy@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org * Vladislav Shpilevoy [19/05/15 04:21]: > SWIM internally tries to avoid unnecessary close+socket+bind > calls on reconfiguration if a new URI is the same as an old one. > SWIM transport compares couples and if they are > equal, does nothing. > > But if a port is 0, it is not a real port, but a sign to the > kernel to find any free port on the IP address. In such a case > SWIM transport after bind() retrieves and saves a real port. > > When the same URI is specified again, the transport compares two > addresses: old , new , sees they are > 'different', and rebinds. It is not necessary, obviously, because > the new URI covers the old one. > > This commit avoids rebind, when new IP == old IP, and new port is > 0. ok to push -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32