influxdata/telegraf

Cancel gracefully when connecting to kafka broker

Open

#12,214 建立於 2022年11月9日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Go (4,161 fork)batch import
area/kafkahelp wantedsize/m

倉庫指標

Star
 (9,892 star)
PR 合併指標
 (平均合併 2天 12小時) (30 天內合併 136 個 PR)

描述

If the user sends a signal to telegraf while kafka_consumer is connecting to the broker (before sarama.NewConsumerGroup() has returned), the signal will be delayed until connection is made or timed out. This means sigint to shut down telegraf, or sighup to reload config are ignored while connecting to the broker.

Since #12111, telegraf allows the kafka connection to be deferred until after startup and to retry for a very long time in case the broker is down. This means the time spent connecting to the broker can be much larger and signals can be blocked indefinitely.

It doesn't look like there is a way to cancel sarama.NewConsumerGroup(). We need to find out if there is a different way to connect that has a way to cancel, or work with upstream to add one.

貢獻者指南