mirror of
https://github.com/netdata/netdata.git
synced 2025-04-15 01:58:34 +00:00
do not send sentry reports on rrd_init() failures (#19628)
This commit is contained in:
parent
fdeacfd8d9
commit
772cc5fff5
3 changed files with 16 additions and 1 deletions
src/daemon
|
@ -12,6 +12,16 @@
|
|||
#include "sentry-native/sentry-native.h"
|
||||
#endif
|
||||
|
||||
static bool abort_on_fatal = true;
|
||||
|
||||
void abort_on_fatal_disable(void) {
|
||||
abort_on_fatal = false;
|
||||
}
|
||||
|
||||
void abort_on_fatal_enable(void) {
|
||||
abort_on_fatal = true;
|
||||
}
|
||||
|
||||
void web_client_cache_destroy(void);
|
||||
|
||||
extern struct netdata_static_thread *static_threads;
|
||||
|
@ -296,7 +306,7 @@ void netdata_cleanup_and_exit(int ret, const char *action, const char *action_re
|
|||
#endif
|
||||
|
||||
#ifdef ENABLE_SENTRY
|
||||
if (ret) {
|
||||
if (ret && abort_on_fatal) {
|
||||
if (action_data) {
|
||||
nd_sentry_add_breadcrumb(action_data);
|
||||
}
|
||||
|
|
|
@ -7,4 +7,7 @@
|
|||
|
||||
void cancel_main_threads(void);
|
||||
|
||||
void abort_on_fatal_disable(void);
|
||||
void abort_on_fatal_enable(void);
|
||||
|
||||
#endif //NETDATA_DAEMON_SHUTDOWN_H
|
||||
|
|
|
@ -959,10 +959,12 @@ int netdata_main(int argc, char **argv) {
|
|||
|
||||
delta_startup_time("initialize RRD structures");
|
||||
|
||||
abort_on_fatal_disable();
|
||||
if(rrd_init(netdata_configured_hostname, system_info, false)) {
|
||||
set_late_analytics_variables(system_info);
|
||||
fatal("Cannot initialize localhost instance with name '%s'.", netdata_configured_hostname);
|
||||
}
|
||||
abort_on_fatal_enable();
|
||||
|
||||
delta_startup_time("check for incomplete shutdown");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue