Skip to content

Commit

Permalink
Add more conditions for conections map to be cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronH88 committed Mar 21, 2024
1 parent 3bc8495 commit 7451a25
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/netceptor/netceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2022,8 +2022,12 @@ func (s *Netceptor) runProtocol(ctx context.Context, sess BackendSession, bi *Ba
select {
case initDoneChan <- true:
case <-ctx.Done():
s.removeConnection(remoteNodeID)

return nil
case <-ci.Context.Done():
s.removeConnection(remoteNodeID)

return nil
}
s.Logger.SanitizedInfo("Connection established with %s\n", remoteNodeID)
Expand All @@ -2043,8 +2047,12 @@ func (s *Netceptor) runProtocol(ctx context.Context, sess BackendSession, bi *Ba
select {
case s.sendRouteFloodChan <- 0:
case <-ctx.Done():
s.removeConnection(remoteNodeID)

return nil
case <-ci.Context.Done():
s.removeConnection(remoteNodeID)

return nil
}
select {
Expand Down

0 comments on commit 7451a25

Please sign in to comment.