Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik committed Sep 4, 2023
1 parent f96fdf6 commit 5df3ea9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/networkservice/common/heal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (h *healClient) Request(ctx context.Context, request *networkservice.Networ
// Cancel any existing eventLoop
loopHandle, loaded := loadAndDelete(ctx)
if loaded {
log.FromContext(ctx).Info("Stopping Event Loop. All pings should be stopped now")
loopHandle.cancel()
if started, ok := <-loopHandle.healingStartedCh; ok {
loopHandle.healingStarted = started
Expand All @@ -79,6 +80,7 @@ func (h *healClient) Request(ctx context.Context, request *networkservice.Networ
}
return nil, err
}
log.FromContext(ctx).Info("Starting Event Loop Again. All pings should be resumed now")
eventLoopErr := h.startEventLoop(ctx, conn)
if eventLoopErr != nil {
closeCtx, closeCancel := closeCtxFunc()
Expand Down
4 changes: 3 additions & 1 deletion pkg/networkservice/common/heal/eventloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,11 @@ func (cev *eventLoop) monitorDataPlane() <-chan struct{} {
for {
select {
case <-ticker.C:
deadlineCtx, deadlineCancel := context.WithDeadline(cev.chainCtx, time.Now().Add(cev.heal.livenessCheckTimeout))
cev.logger.Info("Starting Liveness Check")
deadlineCtx, deadlineCancel := context.WithDeadline(cev.eventLoopCtx, time.Now().Add(cev.heal.livenessCheckTimeout))
alive := cev.heal.livenessCheck(deadlineCtx, cev.conn)
deadlineCancel()
cev.logger.Info("Finishing Liveness Check")
if !alive {
// Start healing
return
Expand Down

0 comments on commit 5df3ea9

Please sign in to comment.