From 949c79313b256f5291fc5b1d42abbed86c9a85ad Mon Sep 17 00:00:00 2001 From: Daniel Grau Date: Wed, 12 Jun 2024 16:46:24 +0000 Subject: [PATCH] lint and timeout --- .github/linters/.golangci.yml | 7 +++++-- .../standalone/pkthandler/pktiohandler/pktiohandler.go | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/linters/.golangci.yml b/.github/linters/.golangci.yml index e9fc6222..76270817 100644 --- a/.github/linters/.golangci.yml +++ b/.github/linters/.golangci.yml @@ -23,10 +23,13 @@ # see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml run: timeout: 60m - skip-dirs: +issues: + exclude-dirs: - gnmi/oc - integration_tests # Loading ondatra is very slow -issues: + exclude: + - "grpc.Dial is deprecated" # TODO: Remove this once UDS is resolved + - "grpc.DialContext is deprecated" exclude-rules: - path: _test\.go linters: diff --git a/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go b/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go index 66919f6c..08032e33 100644 --- a/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go +++ b/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go @@ -263,6 +263,7 @@ func (m *PacketIOMgr) queueRead(id uint64, done chan struct{}) { default: n, err := p.Read(buf) if err != nil || n == 0 { + time.Sleep(time.Millisecond) continue } pkt := &pktiopb.Packet{ @@ -270,7 +271,7 @@ func (m *PacketIOMgr) queueRead(id uint64, done chan struct{}) { Frame: buf[0:n], } m.sendQueue.Write(pkt) - time.Sleep(time.Microsecond) + time.Sleep(time.Millisecond) } } }()