Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] replication: stop pushing TimedOut error to the replica
Date: Fri, 9 Jul 2021 11:30:20 +0300	[thread overview]
Message-ID: <7d4e959e-baab-85ff-488d-d1dbfd5e80a5@tarantool.org> (raw)
In-Reply-To: <YOgB69SswCK7O38P@grain>

09.07.2021 10:59, Cyrill Gorcunov пишет:
> On Fri, Jul 09, 2021 at 10:40:48AM +0300, Serge Petrenko wrote:
>> @@ -549,6 +550,12 @@ iproto_write_error(int fd, const struct error *e, uint32_t schema_version,
>>   	size_t region_svp = region_used(region);
>>   	mpstream_iproto_encode_error(&stream, e);
>> +	struct errinj *inj = errinj(ERRINJ_IPROTO_WRITE_ERROR_LARGE,
>> +				    ERRINJ_INT);
>> +	if (inj != NULL && inj->iparam > 0) {
>> +		char garbage[inj->iparam];
> Serge, I didn't read the patch yet but this moment is very dubious.
> While standart allows to allocate dynamic stack here it may lead
> to unpredicted effects. I would suggest to use malloc if this
> won't cause significant rework, hm? Surely this can be done on
> top of the patch (actually you did a huge amount of great work
> investigating this issue, thanks!!!)

Thanks! No problem, will rework.
It might be better to not allocate any string at all.
I can simply allocate the needed buffer on the region (where the msgpack 
will be encoded),
and encode the string header, and leave the buffer with whatever 
contents it has
(it'll probably be filled with 0x50 bytes, it's the slab poison symbol).

Serge Petrenko

  reply	other threads:[~2021-07-09  8:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09  7:40 Serge Petrenko via Tarantool-patches
2021-07-09  7:59 ` Cyrill Gorcunov via Tarantool-patches
2021-07-09  8:30   ` Serge Petrenko via Tarantool-patches [this message]
2021-07-09 10:41     ` Cyrill Gorcunov via Tarantool-patches
2021-07-12 10:14       ` Serge Petrenko via Tarantool-patches
2021-07-12 10:38         ` Cyrill Gorcunov via Tarantool-patches
2021-07-13 21:49 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-15 10:20   ` Serge Petrenko via Tarantool-patches
2021-07-15 21:04 ` Vladislav Shpilevoy via Tarantool-patches

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d4e959e-baab-85ff-488d-d1dbfd5e80a5@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] replication: stop pushing TimedOut error to the replica' \


* 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