throttling just prior to leaving hibernation, so as to allow re-throttle checks to apply
This commit is contained in:
parent
3955a6d67f
commit
ad47f7c147
@ -40,8 +40,9 @@ const (
|
|||||||
type ThrottleReasonHint string
|
type ThrottleReasonHint string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NoThrottleReasonHint ThrottleReasonHint = "NoThrottleReasonHint"
|
NoThrottleReasonHint ThrottleReasonHint = "NoThrottleReasonHint"
|
||||||
UserCommandThrottleReasonHint = "UserCommandThrottleReasonHint"
|
UserCommandThrottleReasonHint = "UserCommandThrottleReasonHint"
|
||||||
|
LeavingHibernationThrottleReasonHint = "LeavingHibernationThrottleReasonHint"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -289,6 +289,7 @@ func (this *Throttler) collectGeneralThrottleMetrics() error {
|
|||||||
log.Errorf("critical-load met. Will hibernate for the duration of %+v, until %+v", hibernateDuration, hibernateUntilTime)
|
log.Errorf("critical-load met. Will hibernate for the duration of %+v, until %+v", hibernateDuration, hibernateUntilTime)
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(hibernateDuration)
|
time.Sleep(hibernateDuration)
|
||||||
|
this.migrationContext.SetThrottleGeneralCheckResult(base.NewThrottleCheckResult(true, "leaving hibernation", base.LeavingHibernationThrottleReasonHint))
|
||||||
atomic.StoreInt64(&this.migrationContext.HibernateUntil, 0)
|
atomic.StoreInt64(&this.migrationContext.HibernateUntil, 0)
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user