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 eh-steve committed Feb 29, 2024
1 parent b356daa commit e94ca55
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 @@ -50,6 +50,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 e94ca55

Please sign in to comment.