Skip to content

Commit

Permalink
Add missing context cancel calls
Browse files Browse the repository at this point in the history
  • Loading branch information
thom-at-redhat committed Oct 2, 2024
1 parent 1be2c55 commit cbdceb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/netceptor/netceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func NewWithConsts(ctx context.Context, nodeID string,
}
s.AddNameHash(nodeID)
s.context, s.cancelFunc = context.WithCancel(ctx)
defer s.cancelFunc()
s.unreachableBroker = utils.NewBroker(s.context, reflect.TypeOf(UnreachableNotification{}))
s.routingUpdateBroker = utils.NewBroker(s.context, reflect.TypeOf(map[string]string{}))
s.updateRoutingTableChan = tickrunner.Run(s.context, s.updateRoutingTable, time.Hour*24, time.Millisecond*100)
Expand Down
1 change: 1 addition & 0 deletions pkg/netceptor/packetconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (pc *PacketConn) GetLogger() *logger.ReceptorLogger {
// startUnreachable starts monitoring the netceptor unreachable channel and forwarding relevant messages.
func (pc *PacketConn) StartUnreachable() {
pc.context, pc.cancel = context.WithCancel(pc.s.Context())
defer pc.cancel()
pc.unreachableSubs = utils.NewBroker(pc.context, reflect.TypeOf(UnreachableNotification{}))
iChan := pc.s.GetUnreachableBroker().Subscribe()
go func() {
Expand Down

0 comments on commit cbdceb1

Please sign in to comment.