[Tarantool-patches] [PATCH 4/4] cfg: allow to configure crash report sending

Cyrill Gorcunov gorcunov at gmail.com
Wed Dec 2 18:18:42 MSK 2020


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 <gorcunov at gmail.com>

@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



More information about the Tarantool-patches mailing list