Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorres committed Jan 22, 2025
1 parent 3c8d8b3 commit 7a95777
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
11 changes: 4 additions & 7 deletions pkg/rolling/restart_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,11 @@ func (rh *restartHandler) run() {
}
}

func (rh *restartHandler) stopWithDelay() {
close(rh.queue)
rh.wg.Wait()
close(rh.done)
}

func (rh *restartHandler) stopRightNow() {
func (rh *restartHandler) stop(shouldWaitForDelay bool) {
close(rh.queue)
if shouldWaitForDelay {
rh.wg.Wait()
}
close(rh.done)
}

Expand Down
11 changes: 4 additions & 7 deletions pkg/rolling/rolling.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,12 @@ func (r *Rolling) processActionGroupStates(actions []*Ydb_Maintenance.ActionGrou
r.logCompleteResult(result)
r.state.unreportedButFinishedActionIds = []string{}

isRestartCompleted := len(actions) == len(result.ActionStatuses)
restartCompleted := len(actions) == len(result.ActionStatuses)
shouldWaitForDelay := !restartCompleted

if !isRestartCompleted {
restartHandler.stopWithDelay()
} else {
restartHandler.stopRightNow()
}
restartHandler.stop(shouldWaitForDelay)

return isRestartCompleted
return restartCompleted
}

func (r *Rolling) atomicHasActionInUnreported(actionID string) bool {
Expand Down

0 comments on commit 7a95777

Please sign in to comment.