MCPcopy
hub / github.com/segmentio/kafka-go / maxAttempts

Method maxAttempts

writer.go:786–795  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

784}
785
786func (w *Writer) maxAttempts() int {
787 if w.MaxAttempts > 0 {
788 return w.MaxAttempts
789 }
790 // TODO: this is a very high default, if something has failed 9 times it
791 // seems unlikely it will succeed on the 10th attempt. However, it does
792 // carry the risk to greatly increase the volume of requests sent to the
793 // kafka cluster. We should consider reducing this default (3?).
794 return 10
795}
796
797func (w *Writer) writeBackoffMin() time.Duration {
798 if w.WriteBackoffMin > 0 {

Callers 2

StatsMethod · 0.95
writeBatchMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected