From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (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 B6E764696C3 for ; Fri, 1 May 2020 20:02:45 +0300 (MSK) From: Oleg Babin References: <8ef56505d0ff0302c09570eecc55fdbe911c3f17.1588292014.git.v.shpilevoy@tarantool.org> Message-ID: <17f95a5f-9fa5-3807-265c-e66fe176ff21@tarantool.org> Date: Fri, 1 May 2020 20:02:44 +0300 MIME-Version: 1.0 In-Reply-To: <8ef56505d0ff0302c09570eecc55fdbe911c3f17.1588292014.git.v.shpilevoy@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH vshard 7/7] router: introduce discovery mode 'once' List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org Hi! Thanks for the patch. See one nit below. On 01/05/2020 03:16, Vladislav Shpilevoy wrote: > Closes #210 > > @@ -342,6 +342,13 @@ discovery_f = function(router) > unknown_bucket_count = > router.total_bucket_count - router.known_bucket_count > if unknown_bucket_count == 0 then > + if router.discovery_mode == 'once' then > + log.info("Discovery mode is 'once', and all is ".. > + "discovered - shut down the discovery process") > + router.discovery_fiber = nil > + lfiber.self():cancel() > + return > + end I'm not sure that self.cancel is a good approach. I think simple "return" should be enough.