Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Georgy Kirichenko <georgy@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] [PATCH] Don't throw an exception in a replication handler
Date: Thu, 23 Aug 2018 22:57:54 +0300	[thread overview]
Message-ID: <20180823195754.sxorwil73z36ub2z@esperanza> (raw)
In-Reply-To: <d68e3db84a03c216e292d4d701980623aa82113e.1535039855.git.georgy@tarantool.org>

On Thu, Aug 23, 2018 at 07:00:31PM +0300, Georgy Kirichenko wrote:
> It is an error to throw an error out of a cbus message handler because
> it breaks cbus message delivery. In case of replication throwing an
> error prevents iproto against replication socket closing.
> 
> Fixes 3642
> ---
> Branch:
> https://github.com/tarantool/tarantool/tree/g.kirichenko/gh-3642-fix-replication-socket-leak
> Issue: https://github.com/tarantool/tarantool/issues/3642

Please don't prefix branch and issue names with 'Branch' and 'Issue',
because it's pretty clear which is which without them.

The ticket doesn't have a milestone assigned. Please assign one
and rebase your branch on the latest 1.9 or 1.10, depending on
the milestone.

>  src/box/iproto.cc              |  2 +-
>  test/replication/misc.test.lua | 10 ++++++++++
>  2 files changed, 11 insertions(+), 1 deletion(-)

You seem to have forgotten to update the result file.

> 
> diff --git a/src/box/iproto.cc b/src/box/iproto.cc
> index 0b92c316e..df32e4f2b 100644
> --- a/src/box/iproto.cc
> +++ b/src/box/iproto.cc
> @@ -1412,7 +1412,7 @@ tx_process_join_subscribe(struct cmsg *m)
>  			unreachable();
>  		}
>  	} catch (SocketError *e) {
> -		throw; /* don't write error response to prevent SIGPIPE */
> +		return; /* don't write error response to prevent SIGPIPE */
>  	} catch (Exception *e) {
>  		iproto_write_error(con->input.fd, e, ::schema_version,
>  				   msg->header.sync);
> diff --git a/test/replication/misc.test.lua b/test/replication/misc.test.lua
> index 850579769..32ab07924 100644
> --- a/test/replication/misc.test.lua
> +++ b/test/replication/misc.test.lua
> @@ -79,4 +79,14 @@ box.space.space1:drop()
>  test_run:cmd("switch default")
>  test_run:drop_cluster(SERVERS)
>  
> +test_run:cmd('create server sock with rpl_master=default, script="replication/replica.lua"')
> +test_run:cmd(string.format('start server sock'))
> +test_run:cmd('switch sock')
> +fiber = require('fiber')
> +k = tonumber(io.popen('ulimit -n'):read())
> +for i = 2, k > 1024 and 1 or k + 20 do local replication = box.cfg.replication box.cfg{replication = {}} box.cfg{replication = replication} while box.info.replication[1].upstream.status ~= 'follow' do fiber.sleep(0.0001) end end

This line's definitely worth splitting.

This case takes adds another 3 seconds to the replication/misc run time,
which seems to be a little bit too much. Besides, it isn't tested
properly by Travis, because Travis has the fd limit > 1024. I think you
should lower the ulimit in the test. Please try to call setrlimit via
Lua ffi.

> +test_run:cmd('switch default')
> +test_run:cmd('stop server sock')
> +test_run:cmd('cleanup server sock')
> +
>  box.schema.user.revoke('guest', 'replication')

  reply	other threads:[~2018-08-23 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23 16:00 Georgy Kirichenko
2018-08-23 19:57 ` Vladimir Davydov [this message]
2018-08-27 13:28 Georgy Kirichenko
2018-08-27 15:36 ` Vladimir Davydov
2018-08-28 10:16 ` Vladimir Davydov

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=20180823195754.sxorwil73z36ub2z@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] Don'\''t throw an exception in a replication handler' \
    /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