Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] CBUS: fix cbus_unpair behavior
@ 2019-09-10 14:17 Georgy Kirichenko
  2019-09-10 18:56 ` [tarantool-patches] " Vladislav Shpilevoy
  2019-09-10 18:58 ` Vladislav Shpilevoy
  0 siblings, 2 replies; 3+ messages in thread
From: Georgy Kirichenko @ 2019-09-10 14:17 UTC (permalink / raw)
  To: tarantool-patches; +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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-10 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 14:17 [tarantool-patches] [PATCH] CBUS: fix cbus_unpair behavior Georgy Kirichenko
2019-09-10 18:56 ` [tarantool-patches] " Vladislav Shpilevoy
2019-09-10 18:58 ` Vladislav Shpilevoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox