From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: TML <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v4 4/4] crash: report crash data to the feedback server
Date: Sun, 20 Dec 2020 21:26:20 +0300 [thread overview]
Message-ID: <20201220182620.GD3139@grain> (raw)
In-Reply-To: <96e492a5-3866-91ac-801b-c26c1fce96e2@tarantool.org>
On Sun, Dec 20, 2020 at 04:16:46PM +0100, Vladislav Shpilevoy wrote:
> I see you didn't push it on the branch. Please, do. Otherwise I can't
> validate if it works.
OK, I'll make a new branch and address your comments.
> See 6 comments below.
>
> > diff --git a/src/box/box.cc b/src/box/box.cc
> > index a8bc3471d..27079fd46 100644
> > --- a/src/box/box.cc
> > +++ b/src/box/box.cc
> > @@ -1213,6 +1214,21 @@ box_set_prepared_stmt_cache_size(void)
> > return 0;
> > }
> >
> > +void
> > +box_set_crash_params(void)
> > +{
> > + const char *host = cfg_gets("feedback_host");
> > + bool is_enabled_1 = cfg_getb("feedback_enabled");
> > + bool is_enabled_2 = cfg_getb("feedback_crashinfo");
> > +
> > + if (host != NULL && strlen(host) >= CRASH_FEEDBACK_HOST_MAX) {
> > + tnt_raise(ClientError, ER_CFG, "feedback_host",
> > + "the address is too long");
>
> 1. Please, don't use exceptions in the new code. We are getting rid
> of them, and such changes complicate it in future.
Sure!
> > + }
> > +
> > + crash_cfg_set_params(host, is_enabled_1 && is_enabled_2);
>
> 2. Just 'crash_cfg', please. We have lots of 'cfg' functions for
> various modules, and none of them has 'set_params' suffix. Probably
> because this is what 'cfg' means anyway.
OK
> > - char backtrace_buf[4096];
> > + char backtrace_buf[1024];
>
> 3. I am begging you. Please. Stop mixing independent changes with
> each other. Please. How can I ask otherwise? What can I do to
> explain this? How can I help to understand?
Sorry Vlad :(
> > +#define snprintf_safe(__end, __fmt, ...) \
> > + do { \
> > + size_t size = (char *)(void *)__end - p; \
>
> 4. Please, remove the double cast. You can use (char *) as is. Here and
> in other places.
OK
> > + /*
> > + * nodename might a sensitive information, skip.
>
> 5. 'might' what? You missed a verb.
ouch, might contain of course
>
> 6. I think now I understood all these buffer allocs. Except
> that I still don't understand why is tail initialized as
>
> char *tail = &p[SMALL_STATIC_SIZE - 8];
>
> instead of just `tail = end;`.
yes, redundant, will drop.
next prev parent reply other threads:[~2020-12-20 18:26 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 16:18 [Tarantool-patches] [PATCH v4 0/4] crash: implement sending feedback Cyrill Gorcunov
2020-12-10 16:18 ` [Tarantool-patches] [PATCH v4 1/4] util: introduce strlcpy helper Cyrill Gorcunov
2020-12-11 7:34 ` Serge Petrenko
2020-12-11 7:58 ` Serge Petrenko
2020-12-11 10:04 ` Cyrill Gorcunov
2020-12-11 11:07 ` Serge Petrenko
2020-12-11 11:38 ` Cyrill Gorcunov
2020-12-14 22:54 ` Vladislav Shpilevoy
2020-12-14 22:54 ` Vladislav Shpilevoy
2020-12-15 8:47 ` Cyrill Gorcunov
2020-12-10 16:18 ` [Tarantool-patches] [PATCH v4 2/4] backtrace: allow to specify destination buffer Cyrill Gorcunov
2020-12-11 7:50 ` Serge Petrenko
2020-12-10 16:18 ` [Tarantool-patches] [PATCH v4 3/4] crash: move fatal signal handling in Cyrill Gorcunov
2020-12-11 9:31 ` Serge Petrenko
2020-12-11 10:38 ` Cyrill Gorcunov
2020-12-11 11:12 ` Serge Petrenko
2020-12-14 22:54 ` Vladislav Shpilevoy
2020-12-15 8:16 ` Cyrill Gorcunov
2020-12-20 14:48 ` Vladislav Shpilevoy
2020-12-20 15:49 ` Cyrill Gorcunov
2020-12-20 16:07 ` Vladislav Shpilevoy
2020-12-20 16:58 ` Cyrill Gorcunov
2020-12-20 15:45 ` Vladislav Shpilevoy
2020-12-10 16:18 ` [Tarantool-patches] [PATCH v4 4/4] crash: report crash data to the feedback server Cyrill Gorcunov
2020-12-11 12:57 ` Serge Petrenko
2020-12-12 16:19 ` Cyrill Gorcunov
2020-12-12 17:07 ` Cyrill Gorcunov
2020-12-14 9:41 ` Serge Petrenko
2020-12-14 22:54 ` Vladislav Shpilevoy
2020-12-16 11:16 ` Cyrill Gorcunov
2020-12-16 20:31 ` Cyrill Gorcunov
2020-12-20 15:16 ` Vladislav Shpilevoy
2020-12-20 18:26 ` Cyrill Gorcunov [this message]
2020-12-20 14:48 ` Vladislav Shpilevoy
2020-12-20 18:21 ` Cyrill Gorcunov
2020-12-20 18:41 ` Vladislav Shpilevoy
2020-12-20 19:16 ` Cyrill Gorcunov
2020-12-21 17:01 ` 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=20201220182620.GD3139@grain \
--to=gorcunov@gmail.com \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v4 4/4] crash: report crash data to the feedback server' \
/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