Skip to content

Commit

Permalink
fix channel close (#264)
Browse files Browse the repository at this point in the history
Co-authored-by: XingQiang Bai <[email protected]>
  • Loading branch information
ltmhaha and bxq2011hust authored Feb 27, 2024
1 parent 5138ffe commit 4b1b05a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions conn/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,13 @@ func (hc *channelSession) processMessages() {
select {
case <-hc.closed:
// delete old network
_ = hc.c.Close()
hc.c = nil
if hc.c != nil {
err := hc.c.Close()
if err != nil {
logrus.Warnf("close channel failed, err: %v\n", err)
}
hc.c = nil
}
// return err for responses and receiptResponses
hc.mu.Lock()
for _, response := range hc.responses {
Expand Down

0 comments on commit 4b1b05a

Please sign in to comment.