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

Fixed consumer fetch max wait time due to Sarama potential bug #183

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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