v0.278.0: a hold left by an earlier install no longer holds the new one (R-704)
gates / gates (push) Successful in 26s
gates / gates (push) Successful in 26s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -1917,19 +1917,22 @@ func (s *Settings) ClearRestoreHold(stack string) (bool, error) {
|
||||
return true, s.save()
|
||||
}
|
||||
|
||||
// ClearUpdateHold (R-491, v0.242.0) removes an app's hold ONLY when it is an update hold. An R-379
|
||||
// restore hold stays: that one means a database was left in an unknown state and is cleared by the
|
||||
// operator (`-clear-restore-hold`), never by a removal. Returns whether an update hold was cleared.
|
||||
// ClearUpdateHold (R-491, v0.242.0) removes an app's hold when it belongs to the app's INSTALL: an update
|
||||
// hold, and since v0.278.0 (R-704) the box's crash-loop/OOM stop (HoldReasonUnhealthyStop) — both name an
|
||||
// install that a removal ends, and the name is all a later install shares with it. An R-379 restore hold
|
||||
// stays: that one means a database was left in an unknown state and is cleared by the operator
|
||||
// (`-clear-restore-hold`), never by a removal or an install. Returns whether a hold was cleared.
|
||||
// Pinned by TestR704_ClearUpdateHoldClearsTheInstallsHoldsOnly.
|
||||
func (s *Settings) ClearUpdateHold(stack string) (bool, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
h, ok := s.RestoreHolds[stack]
|
||||
if !ok || h.Reason != HoldReasonUpdateFailed {
|
||||
if !ok || (h.Reason != HoldReasonUpdateFailed && h.Reason != HoldReasonUnhealthyStop) {
|
||||
return false, nil
|
||||
}
|
||||
delete(s.RestoreHolds, stack)
|
||||
if s.log != nil {
|
||||
s.log.Printf("[INFO] [settings] update hold CLEARED for %s (the app was removed)", stack)
|
||||
s.log.Printf("[INFO] [settings] %s hold CLEARED for %s (set %s; its install is gone)", h.Reason, stack, h.At)
|
||||
}
|
||||
return true, s.save()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user