mirror of
https://github.com/coredns/coredns.git
synced 2026-04-05 19:55:32 -04:00
chore: bump golangci-lint to v2.11.4 (#7983)
This commit is contained in:
@@ -36,7 +36,7 @@ type dio struct {
|
||||
proto string
|
||||
enc *encoder
|
||||
queue chan *tap.Dnstap
|
||||
dropped uint32
|
||||
dropped atomic.Uint32
|
||||
quit chan struct{}
|
||||
flushTimeout time.Duration
|
||||
tcpTimeout time.Duration
|
||||
@@ -108,7 +108,7 @@ func (d *dio) Dnstap(payload *tap.Dnstap) {
|
||||
select {
|
||||
case d.queue <- payload:
|
||||
default:
|
||||
atomic.AddUint32(&d.dropped, 1)
|
||||
d.dropped.Add(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ func (d *dio) serve() {
|
||||
return
|
||||
case payload := <-d.queue:
|
||||
if err := d.write(payload); err != nil {
|
||||
atomic.AddUint32(&d.dropped, 1)
|
||||
d.dropped.Add(1)
|
||||
if !errors.Is(err, errNoOutput) {
|
||||
// Redial immediately if it's not an output connection error
|
||||
d.dial()
|
||||
@@ -153,7 +153,7 @@ func (d *dio) serve() {
|
||||
d.enc.flush()
|
||||
}
|
||||
case <-errorCheckTicker.C:
|
||||
if dropped := atomic.SwapUint32(&d.dropped, 0); dropped > 0 {
|
||||
if dropped := d.dropped.Swap(0); dropped > 0 {
|
||||
d.logger.Warningf("Dropped dnstap messages: %d\n", dropped)
|
||||
}
|
||||
if d.enc == nil {
|
||||
|
||||
Reference in New Issue
Block a user