From: Georgy Kirichenko <georgy@tarantool.org> To: tarantool-patches@freelists.org Cc: Georgy Kirichenko <georgy@tarantool.org> Subject: [tarantool-patches] [PATCH] CBUS: fix cbus_unpair behavior Date: Tue, 10 Sep 2019 17:17:35 +0300 [thread overview] Message-ID: <20190910141735.8952-1-georgy@tarantool.org> (raw) 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
next reply other threads:[~2019-09-10 14:17 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-10 14:17 Georgy Kirichenko [this message] 2019-09-10 18:56 ` [tarantool-patches] " Vladislav Shpilevoy 2019-09-10 18:58 ` Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190910141735.8952-1-georgy@tarantool.org \ --to=georgy@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] [PATCH] CBUS: fix cbus_unpair behavior' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox