[Tarantool-patches] [PATCH v4 4/4] crash: report crash data to the feedback server
Cyrill Gorcunov
gorcunov at gmail.com
Sun Dec 20 22:16:54 MSK 2020
On Sun, Dec 20, 2020 at 07:41:47PM +0100, Vladislav Shpilevoy wrote:
>
> The error above I checked on your branch. And it remains the same
> even with the latest commit which you didn't push yet. Because the
> feedback options still are not configured before box.cfg. It has
> nothing to do with the recursive crash.
>
> It means, as I said above, that you can't send a crash before
> box.cfg is done. Therefore you can simply not even try if the
> host is not configured yet. It solves the error message, and alongside
> solves the crash chain issue. You don't need environment variables
> for this.
>
> I would suggest not to rush responding to these emails, but give it
> some thought beforehand.
>
> It is actually strange, that feedback daemon does not work before
> box.cfg. We don't see any reports from tarantool instances which are
> used as an application server. But it has nothing to do with your
> patch anyway.
The latest updates are in gorcunov/gh-5261-crash-report-4-rev2
---
...
static bool send_crashinfo = false;
...
static void
crash_signal_cb(int signo, siginfo_t *siginfo, void *context)
{
static volatile sig_atomic_t in_cb = 0;
struct crash_info *cinfo;
if (in_cb == 0) {
in_cb = 1;
cinfo = crash_collect(signo, siginfo, context);
crash_report_stderr(cinfo);
if (send_crashinfo)
crash_report_feedback_daemon(cinfo);
} else {
/* Got a signal while running the handler. */
fprintf(stderr, "Fatal %d while backtracing", signo);
}
/* Try to dump a core */
struct sigaction sa = {
.sa_handler = SIG_DFL,
};
sigemptyset(&sa.sa_mask);
sigaction(SIGABRT, &sa, NULL);
abort();
}
...
void
crash_cfg_set_params(const char *host, bool is_enabled)
{
if (host == NULL || !is_enabled) {
if (send_crashinfo) {
pr_debug("disable sending crashinfo feedback");
send_crashinfo = false;
feedback_host[0] = '\0';
}
return;
}
if (strcmp(feedback_host, host) != 0) {
strlcpy_a(feedback_host, host);
if (strlen(feedback_host) < strlen(host))
pr_panic("feedback_host is too long");
}
if (!send_crashinfo) {
pr_debug("enable sending crashinfo feedback");
send_crashinfo = true;
}
}
---
IOW, until explicitly configured via box.cfg{} the crash won't
be sent. I'll address all your previous comments in v5 of the branch.
More information about the Tarantool-patches
mailing list