Skip to content

Commit 131cfdf

Browse files
committed
in_node_exporter_metrics: delete collector on init failure
Signed-off-by: Stefano Tondo <stondo@gmail.com>
1 parent 6fc6592 commit 131cfdf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • plugins/in_node_exporter_metrics

plugins/in_node_exporter_metrics/ne.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ static int activate_collector(struct flb_ne *ctx, struct flb_config *config,
154154

155155
ret = coll->cb_init(ctx);
156156
if (ret != 0) {
157+
if (coll->cb_update && coll->coll_fd >= 0) {
158+
flb_input_collector_delete(coll->coll_fd, ctx->ins);
159+
coll->coll_fd = -1;
160+
}
157161
flb_plg_error(ctx->ins, "%s init failed", name);
158162
return -1;
159163
}

0 commit comments

Comments
 (0)