Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org,
	Georgy Kirichenko <georgy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] CBUS: fix cbus_unpair behavior
Date: Tue, 10 Sep 2019 20:56:41 +0200	[thread overview]
Message-ID: <9a483d77-e69e-e7d9-2f8f-163225395fa3@tarantool.org> (raw)
In-Reply-To: <20190910141735.8952-1-georgy@tarantool.org>

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;
>  };

  reply	other threads:[~2019-09-10 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 14:17 [tarantool-patches] " Georgy Kirichenko
2019-09-10 18:56 ` Vladislav Shpilevoy [this message]
2019-09-10 18:58 ` [tarantool-patches] " 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=9a483d77-e69e-e7d9-2f8f-163225395fa3@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [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