Skip to content

chore(config): update comments of sarama.Config.Metadata.SingleFlight#3296

Merged
dnwe merged 1 commit intoIBM:mainfrom
gunli:update-single-comments
Sep 18, 2025
Merged

chore(config): update comments of sarama.Config.Metadata.SingleFlight#3296
dnwe merged 1 commit intoIBM:mainfrom
gunli:update-single-comments

Conversation

@gunli
Copy link
Copy Markdown
Contributor

@gunli gunli commented Sep 18, 2025

This PR update the default value in comment of sarama.Config.Metadata.SingleFlight because it is set to true in function NewConfig()

// NewConfig returns a new configuration instance with sane defaults.
func NewConfig() *Config {
	c := &Config{}

	c.Admin.Retry.Max = 5
	c.Admin.Retry.Backoff = 100 * time.Millisecond
	c.Admin.Timeout = 3 * time.Second

	c.Net.MaxOpenRequests = 5
	c.Net.DialTimeout = 30 * time.Second
	c.Net.ReadTimeout = 30 * time.Second
	c.Net.WriteTimeout = 30 * time.Second
	c.Net.SASL.Handshake = true
	c.Net.SASL.Version = SASLHandshakeV1

	c.Metadata.Retry.Max = 3
	c.Metadata.Retry.Backoff = 250 * time.Millisecond
	c.Metadata.RefreshFrequency = 10 * time.Minute
	c.Metadata.Full = true
	c.Metadata.AllowAutoTopicCreation = true
	c.Metadata.SingleFlight = true

	c.Producer.MaxMessageBytes = 1024 * 1024
	c.Producer.RequiredAcks = WaitForLocal
	c.Producer.Timeout = 10 * time.Second
	c.Producer.Partitioner = NewHashPartitioner
	c.Producer.Retry.Max = 3
	c.Producer.Retry.Backoff = 100 * time.Millisecond
	c.Producer.Return.Errors = true
	c.Producer.CompressionLevel = CompressionLevelDefault

	c.Producer.Transaction.Timeout = 1 * time.Minute
	c.Producer.Transaction.Retry.Max = 50
	c.Producer.Transaction.Retry.Backoff = 100 * time.Millisecond

	c.Consumer.Fetch.Min = 1
	c.Consumer.Fetch.Default = 1024 * 1024
	c.Consumer.Retry.Backoff = 2 * time.Second
	c.Consumer.MaxWaitTime = 500 * time.Millisecond
	c.Consumer.MaxProcessingTime = 100 * time.Millisecond
	c.Consumer.Return.Errors = false
	c.Consumer.Offsets.AutoCommit.Enable = true
	c.Consumer.Offsets.AutoCommit.Interval = 1 * time.Second
	c.Consumer.Offsets.Initial = OffsetNewest
	c.Consumer.Offsets.Retry.Max = 3

	c.Consumer.Group.Session.Timeout = 10 * time.Second
	c.Consumer.Group.Heartbeat.Interval = 3 * time.Second
	c.Consumer.Group.Rebalance.GroupStrategies = []BalanceStrategy{NewBalanceStrategyRange()}
	c.Consumer.Group.Rebalance.Timeout = 60 * time.Second
	c.Consumer.Group.Rebalance.Retry.Max = 4
	c.Consumer.Group.Rebalance.Retry.Backoff = 2 * time.Second
	c.Consumer.Group.ResetInvalidOffsets = true

	c.ClientID = defaultClientID
	c.ChannelBufferSize = 256
	c.ApiVersionsRequest = true
	c.Version = DefaultVersion
	c.MetricRegistry = metrics.NewRegistry()

	return c
}

@gunli gunli force-pushed the update-single-comments branch from 784abb5 to fa214ff Compare September 18, 2025 03:31
@dnwe
Copy link
Copy Markdown
Collaborator

dnwe commented Sep 18, 2025

Ah thanks! This was missed in #3231

@dnwe dnwe added the chore label Sep 18, 2025
@dnwe dnwe merged commit 096b846 into IBM:main Sep 18, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants