Skip to content

Commit

Permalink
Set read/write/metadata timeouts to the provider configured timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous authored and Mongey committed Apr 8, 2024
1 parent a6f2ce6 commit 40dacea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func (c *Config) newKafkaConfig() (*sarama.Config, error) {
kafkaConfig.Net.Proxy.Enable = true
kafkaConfig.Net.Proxy.Dialer = proxy.FromEnvironment()

kafkaConfig.Net.ReadTimeout = time.Duration(c.Timeout) * time.Second
kafkaConfig.Net.WriteTimeout = time.Duration(c.Timeout) * time.Second
kafkaConfig.Metadata.Timeout = time.Duration(c.Timeout) * time.Second

if c.saslEnabled() {
switch c.SASLMechanism {
case "scram-sha512":
Expand Down

0 comments on commit 40dacea

Please sign in to comment.