Skip to content

Commit

Permalink
Add an error log to debug errors on the ci test
Browse files Browse the repository at this point in the history
Relates to #270
  • Loading branch information
enobufs committed Dec 30, 2023
1 parent 3f3866e commit af42e04
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions association.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ func (a *Association) closeAllTimers() {

func (a *Association) readLoop() {
var closeErr error

a.log.Debugf("[%s] readLoop entered", a.name)
defer func() {
// also stop writeLoop, otherwise writeLoop can be leaked
// if connection is lost when there is no writing packet.
Expand All @@ -526,9 +528,14 @@ func (a *Association) readLoop() {
a.log.Debugf("[%s] stats nT3Timeouts : %d", a.name, a.stats.getNumT3Timeouts())
a.log.Debugf("[%s] stats nAckTimeouts: %d", a.name, a.stats.getNumAckTimeouts())
a.log.Debugf("[%s] stats nFastRetrans: %d", a.name, a.stats.getNumFastRetrans())

if errors.Is(closeErr, net.ErrClosed) || errors.Is(closeErr, io.EOF) {
a.log.Debugf("[%s] readLoop exited %s", a.name, closeErr)

Check warning on line 533 in association.go

View check run for this annotation

Codecov / codecov/patch

association.go#L533

Added line #L533 was not covered by tests
} else {
a.log.Errorf("[%s] readLoop exited %s", a.name, closeErr)
}
}()

a.log.Debugf("[%s] readLoop entered", a.name)
buffer := make([]byte, receiveMTU)

for {
Expand All @@ -549,8 +556,6 @@ func (a *Association) readLoop() {
break
}
}

a.log.Debugf("[%s] readLoop exited %s", a.name, closeErr)
}

func (a *Association) writeLoop() {
Expand Down

0 comments on commit af42e04

Please sign in to comment.