Skip to content

Add reconnect_backoff_max_ms option for configuring kafka client#204

Merged
kaisecheng merged 2 commits intologstash-plugins:mainfrom
kaisecheng:add_reconnect_backoff_max
Oct 3, 2025
Merged

Add reconnect_backoff_max_ms option for configuring kafka client#204
kaisecheng merged 2 commits intologstash-plugins:mainfrom
kaisecheng:add_reconnect_backoff_max

Conversation

@kaisecheng
Copy link
Contributor

@kaisecheng kaisecheng commented Oct 1, 2025

Add reconnect_backoff_max_ms option for configuring kafka client.
The default value is 1000, the same as the Kafka default
Fixes: #194

Tested Logstash with this kafka and no warning about "Disabling exponential reconnect backoff because reconnect.backoff.ms is set, but reconnect.backoff.max.ms is not"

The test was failing intermittently because failcount could be 0,
causing the first producer#send call to skip.
The random value does not test different behaviors, hence, changed to fix number.
@kaisecheng kaisecheng marked this pull request as ready for review October 2, 2025 11:10

context "when KafkaProducer#send() raises a non-retriable exception" do
let(:failcount) { (rand * 10).to_i }
let(:failcount) { 3 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test was failing intermittently because failcount could be 0,
causing the first producer#send call to skip.
The random value does not test different behaviors, hence, changed to fix number.

Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaisecheng kaisecheng merged commit 7a93697 into logstash-plugins:main Oct 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants