From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D54F545C304 for ; Wed, 2 Dec 2020 18:19:36 +0300 (MSK) Received: by mail-lj1-f169.google.com with SMTP id s9so4129069ljo.11 for ; Wed, 02 Dec 2020 07:19:36 -0800 (PST) From: Cyrill Gorcunov Date: Wed, 2 Dec 2020 18:18:42 +0300 Message-Id: <20201202151842.415456-5-gorcunov@gmail.com> In-Reply-To: <20201202151842.415456-1-gorcunov@gmail.com> References: <20201202151842.415456-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 4/4] cfg: allow to configure crash report sending List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Vladislav Shpilevoy Introcude a new option to box.cfg{} to control sending of crash report. There is no simple way to test all this because it involves subsequent runs of tarantool. I've been using one terminal with tarantool running inside as > box.cfg{feedback_host="127.0.0.1:1500", feedback_crash=true} another terminal to listen for incoming data > while true ; do nc -l -p 1500 -c 'echo -e "HTTP/1.1 200 OK\n\n $(date)"'; done and one another to kill main tarantool instance > kill -11 `pidof tarantool` Closes #5261 Signed-off-by: Cyrill Gorcunov @TarantoolBot document Title: Send crash dump to feedback server The default feedback server gathers only small portion of usage statistics. Setting up option `feedback_crash=true` in box configuration allows to send detailed information in case of program crash. This information includes: - utsname information (similar to `uname -a` output except the network name) - build information - reason for a crash - call backtrace By default the option `feedback_crash` is disabled. --- src/box/box.cc | 2 ++ src/box/lua/load_cfg.lua | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/box/box.cc b/src/box/box.cc index 4070cbeab..f6e515af8 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -79,6 +79,7 @@ #include "sql_stmt_cache.h" #include "msgpack.h" #include "raft.h" +#include "errstat.h" #include "trivia/util.h" static char status[64] = "unknown"; @@ -2665,6 +2666,7 @@ box_cfg_xc(void) port_init(); iproto_init(); sql_init(); + box_errstat_cfg(); int64_t wal_max_size = box_check_wal_max_size(cfg_geti64("wal_max_size")); enum wal_mode wal_mode = box_check_wal_mode(cfg_gets("wal_mode")); diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua index 76e2e92c2..d0591d12a 100644 --- a/src/box/lua/load_cfg.lua +++ b/src/box/lua/load_cfg.lua @@ -99,6 +99,7 @@ local default_cfg = { replication_skip_conflict = false, replication_anon = false, feedback_enabled = true, + feedback_crash = false, feedback_host = "https://feedback.tarantool.io", feedback_interval = 3600, net_msg_max = 768, @@ -179,6 +180,7 @@ local template_cfg = { replication_skip_conflict = 'boolean', replication_anon = 'boolean', feedback_enabled = ifdef_feedback('boolean'), + feedback_crash = ifdef_feedback('boolean'), feedback_host = ifdef_feedback('string'), feedback_interval = ifdef_feedback('number'), net_msg_max = 'number', @@ -277,6 +279,7 @@ local dynamic_cfg = { checkpoint_wal_threshold = private.cfg_set_checkpoint_wal_threshold, worker_pool_threads = private.cfg_set_worker_pool_threads, feedback_enabled = ifdef_feedback_set_params, + feedback_crash = ifdef_feedback_set_params, feedback_host = ifdef_feedback_set_params, feedback_interval = ifdef_feedback_set_params, -- do nothing, affects new replicas, which query this value on start -- 2.26.2