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 64098216AB for ; Tue, 10 Sep 2019 10:17:39 -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 vDDfg7xcWraB for ; Tue, 10 Sep 2019 10:17:39 -0400 (EDT) Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (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 20D47215D0 for ; Tue, 10 Sep 2019 10:17:39 -0400 (EDT) From: Georgy Kirichenko Subject: [tarantool-patches] [PATCH] CBUS: fix cbus_unpair behavior Date: Tue, 10 Sep 2019 17:17:35 +0300 Message-Id: <20190910141735.8952-1-georgy@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Georgy Kirichenko Each side should close outgoing cpipe while cbus unpair processing. 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; bool complete; struct fiber_cond cond; }; @@ -579,7 +580,7 @@ cbus_unpair_perform(struct cmsg *cmsg) }; cmsg_init(cmsg, route); cpipe_push(msg->src_pipe, cmsg); - cpipe_destroy(msg->src_pipe); + cpipe_destroy(msg->dest_pipe); } static void @@ -607,6 +608,7 @@ cbus_unpair(struct cpipe *dest_pipe, struct cpipe *src_pipe, msg.unpair_cb = unpair_cb; msg.unpair_arg = unpair_arg; msg.src_pipe = src_pipe; + msg.dest_pipe = dest_pipe; msg.complete = false; fiber_cond_create(&msg.cond); @@ -621,7 +623,7 @@ cbus_unpair(struct cpipe *dest_pipe, struct cpipe *src_pipe, fiber_cond_wait(&msg.cond); } - cpipe_destroy(dest_pipe); + cpipe_destroy(src_pipe); } void -- 2.23.0