Skip to content

Commit

Permalink
improve heal monitor cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Danil Uzlov <DanilUzlov@yandex.ru>
  • Loading branch information
d-uzlov committed Jun 19, 2023
1 parent 0ff7602 commit 945b583
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/networkservice/common/heal/eventloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
type eventLoop struct {
heal *healClient
eventLoopCtx context.Context
eventLoopCancel context.CancelFunc
chainCtx context.Context
conn *networkservice.Connection
eventFactory begin.EventFactory
Expand Down Expand Up @@ -81,6 +82,7 @@ func newEventLoop(ctx context.Context, cc grpc.ClientConnInterface, conn *networ
cev := &eventLoop{
heal: heal,
eventLoopCtx: eventLoopCtx,
eventLoopCancel: eventLoopCancel,
chainCtx: ctx,
conn: conn,
eventFactory: ev,
Expand Down Expand Up @@ -136,6 +138,8 @@ func (cev *eventLoop) eventLoop() {

func (cev *eventLoop) waitForEvents() (needToHeal, reselect bool) {
defer close(cev.monitorFinishedCh)
// make sure we stop all monitors
defer cev.eventLoopCancel()

ctrlPlaneCh := cev.monitorCtrlPlane()
dataPlaneCh := cev.monitorDataPlane()
Expand Down

0 comments on commit 945b583

Please sign in to comment.