Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Fixed consumer fetch max wait time due to Sarama potential bug (#183)
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Patierno <[email protected]>
  • Loading branch information
ppatierno committed Jun 1, 2022
1 parent 324cc95 commit d67b17f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var (
)

var saramaLogger = log.New(io.Discard, "[Sarama] ", log.LstdFlags)

func main() {
// get canary configuration
canaryConfig := config.NewCanaryConfig()
Expand Down Expand Up @@ -98,7 +99,9 @@ func newClient(canaryConfig *config.CanaryConfig) (sarama.Client, error) {
config.Producer.RequiredAcks = sarama.WaitForAll
config.Producer.Retry.Max = 0
config.Consumer.Return.Errors = true

// this Sarama fix https://github.com/Shopify/sarama/pull/2227 increases the canary e2e latency
// it shows a potential bug in Sarama. We revert the value back here while waiting for a Sarama fix
config.Consumer.MaxWaitTime = 250 * time.Millisecond

if canaryConfig.TLSEnabled {
config.Net.TLS.Enable = true
Expand Down

0 comments on commit d67b17f

Please sign in to comment.