Stop counting a partly filled send vector as a failure
This commit is contained in:
@@ -10,8 +10,7 @@ type txStats struct {
|
||||
frames atomic.Uint64
|
||||
bytes atomic.Uint64
|
||||
errs atomic.Uint64
|
||||
short atomic.Uint64
|
||||
_ [32]byte
|
||||
_ [40]byte
|
||||
}
|
||||
|
||||
type txWorker struct {
|
||||
@@ -62,13 +61,10 @@ func (w *txWorker) run(done *atomic.Bool) {
|
||||
w.stats.bytes.Add(b)
|
||||
seq += uint64(n)
|
||||
}
|
||||
if n < w.batch {
|
||||
switch {
|
||||
case n < 0 && err != unix.EINTR && err != unix.EAGAIN && err != unix.ENOBUFS:
|
||||
w.stats.errs.Add(1)
|
||||
default:
|
||||
w.stats.short.Add(1)
|
||||
}
|
||||
// Taking fewer of the vector than offered is the ring's room, not a frame
|
||||
// lost: the rest go on the next pass.
|
||||
if n < 0 && err != unix.EINTR && err != unix.EAGAIN && err != unix.ENOBUFS {
|
||||
w.stats.errs.Add(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user