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 E7EA721111 for ; Tue, 10 Sep 2019 14:53:00 -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 AGyb1a_LDeoc for ; Tue, 10 Sep 2019 14:53:00 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 A6AEA20FD6 for ; Tue, 10 Sep 2019 14:52:59 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH] CBUS: fix cbus_unpair behavior References: <20190910141735.8952-1-georgy@tarantool.org> From: Vladislav Shpilevoy Message-ID: <9a483d77-e69e-e7d9-2f8f-163225395fa3@tarantool.org> Date: Tue, 10 Sep 2019 20:56:41 +0200 MIME-Version: 1.0 In-Reply-To: <20190910141735.8952-1-georgy@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: tarantool-patches@freelists.org, Georgy Kirichenko Hi! Thanks for the patch! See 3 comments below. 1. We don't normally use uppercase in commit titles. Please, use 'cbus', not 'CBUS'. On 10/09/2019 16:17, Georgy Kirichenko wrote: > Each side should close outgoing cpipe while cbus unpair processing. 2. Why? I didn't understand it. Please, explain in more details. As I see in the code, cbus_pair() does cpipe_create(dest_pipe) in the caller thread, and cbus_pair_perform() does cpipe_create(msg->src_pipe) in the target thread. On the other hand cbus_unpair() does cpipe_destroy(dest_pipe) and cbus_unpair_perform() does cpipe_destroy(msg->src_pipe). Looks symmetrical. What was wrong here? > > Fixes: #4484 > --- > Branch: https://github.com/tarantool/tarantool/tree/g.kirichenko/gh-4484-cbus-unpair-cpipe-destroy > Issue: https://github.com/tarantool/tarantool/issues/4484 > src/lib/core/cbus.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/lib/core/cbus.c b/src/lib/core/cbus.c > index b3b1280e7..78f3e5341 100644 > --- a/src/lib/core/cbus.c > +++ b/src/lib/core/cbus.c > @@ -547,6 +547,7 @@ struct cbus_unpair_msg { > void (*unpair_cb)(void *); > void *unpair_arg; > struct cpipe *src_pipe; > + struct cpipe *dest_pipe; 3. Please, use 'dst'. When we have 'src', for destination we conventionally use 'dst'. > bool complete; > struct fiber_cond cond; > };