Skip to content

Commit ad47f7c

Browse files
author
Shlomi Noach
committed
throttling just prior to leaving hibernation, so as to allow re-throttle checks to apply
1 parent 3955a6d commit ad47f7c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

go/base/context.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ const (
4040
type ThrottleReasonHint string
4141

4242
const (
43-
NoThrottleReasonHint ThrottleReasonHint = "NoThrottleReasonHint"
44-
UserCommandThrottleReasonHint = "UserCommandThrottleReasonHint"
43+
NoThrottleReasonHint ThrottleReasonHint = "NoThrottleReasonHint"
44+
UserCommandThrottleReasonHint = "UserCommandThrottleReasonHint"
45+
LeavingHibernationThrottleReasonHint = "LeavingHibernationThrottleReasonHint"
4546
)
4647

4748
const (

go/logic/throttler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ func (this *Throttler) collectGeneralThrottleMetrics() error {
289289
log.Errorf("critical-load met. Will hibernate for the duration of %+v, until %+v", hibernateDuration, hibernateUntilTime)
290290
go func() {
291291
time.Sleep(hibernateDuration)
292+
this.migrationContext.SetThrottleGeneralCheckResult(base.NewThrottleCheckResult(true, "leaving hibernation", base.LeavingHibernationThrottleReasonHint))
292293
atomic.StoreInt64(&this.migrationContext.HibernateUntil, 0)
293294
}()
294295
return nil

0 commit comments

Comments
 (0)