Skip to content

Commit

Permalink
Move the log before closing the channel
Browse files Browse the repository at this point in the history
Relates to #270
  • Loading branch information
enobufs committed Dec 30, 2023
1 parent af42e04 commit 17b6c9b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions association.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ func (a *Association) readLoop() {
}
a.lock.Unlock()
close(a.acceptCh)

a.log.Errorf("[%s] readLoop exited %s", a.name, closeErr)
close(a.readLoopCloseCh)

a.log.Debugf("[%s] association closed", a.name)
Expand All @@ -528,12 +530,6 @@ 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)
} else {
a.log.Errorf("[%s] readLoop exited %s", a.name, closeErr)
}
}()

buffer := make([]byte, receiveMTU)
Expand Down

0 comments on commit 17b6c9b

Please sign in to comment.