diff options
author | Vladimir Kobal <vlad@prokk.net> | 2020-05-14 11:42:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 11:42:40 +0300 |
commit | a606a27f164b1c704d850c838a7b89d6c6e0c17c (patch) | |
tree | 1d653e680fa8b6f9c1a6653d87ac6faef60c71f9 /exporting/exporting_engine.h | |
parent | bb61e46e71777b467513a2b102fccdc5f5a8cd0b (diff) |
Fix error handling in exporting connector (#8910)
Diffstat (limited to 'exporting/exporting_engine.h')
-rw-r--r-- | exporting/exporting_engine.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/exporting/exporting_engine.h b/exporting/exporting_engine.h index 9673e823d6..7dc79e3956 100644 --- a/exporting/exporting_engine.h +++ b/exporting/exporting_engine.h @@ -151,6 +151,7 @@ struct instance { struct stats stats; int scheduled; + int disabled; int skip_host; int skip_chart; @@ -203,8 +204,7 @@ EXPORTING_CONNECTOR_TYPE exporting_select_type(const char *type); int init_connectors(struct engine *engine); int mark_scheduled_instances(struct engine *engine); -int prepare_buffers(struct engine *engine); -int notify_workers(struct engine *engine); +void prepare_buffers(struct engine *engine); size_t exporting_name_copy(char *dst, const char *src, size_t max_len); @@ -216,13 +216,13 @@ calculated_number exporting_calculate_value_from_stored_data( RRDDIM *rd, time_t *last_timestamp); -int start_batch_formatting(struct engine *engine); -int start_host_formatting(struct engine *engine, RRDHOST *host); -int start_chart_formatting(struct engine *engine, RRDSET *st); -int metric_formatting(struct engine *engine, RRDDIM *rd); -int end_chart_formatting(struct engine *engine, RRDSET *st); -int end_host_formatting(struct engine *engine, RRDHOST *host); -int end_batch_formatting(struct engine *engine); +void start_batch_formatting(struct engine *engine); +void start_host_formatting(struct engine *engine, RRDHOST *host); +void start_chart_formatting(struct engine *engine, RRDSET *st); +void metric_formatting(struct engine *engine, RRDDIM *rd); +void end_chart_formatting(struct engine *engine, RRDSET *st); +void end_host_formatting(struct engine *engine, RRDHOST *host); +void end_batch_formatting(struct engine *engine); int flush_host_labels(struct instance *instance, RRDHOST *host); int simple_connector_update_buffered_bytes(struct instance *instance); @@ -235,6 +235,14 @@ void create_main_rusage_chart(RRDSET **st_rusage, RRDDIM **rd_user, RRDDIM **rd_ void send_main_rusage(RRDSET *st_rusage, RRDDIM *rd_user, RRDDIM *rd_system); void send_internal_metrics(struct instance *instance); +static inline void disable_instance(struct instance *instance) +{ + instance->disabled = 1; + instance->scheduled = 0; + uv_mutex_unlock(&instance->mutex); + error("EXPORTING: Instance %s disabled", instance->config.name); +} + #include "exporting/prometheus/prometheus.h" #endif /* NETDATA_EXPORTING_ENGINE_H */ |