fix: int overflow in exponential backoff hook error policy (#619)
Build Snapshot Release / build (push) Has been cancelled
Release Please / release-please (push) Has been cancelled
Test / test-nix (push) Has been cancelled
Test / test-win (push) Has been cancelled

This commit is contained in:
Gareth
2024-12-21 14:17:30 -08:00
committed by GitHub
parent a1e3a708eb
commit 1ff69f121a
+1 -1
View File
@@ -137,7 +137,7 @@ func applyHookErrorPolicy(onError v1.Hook_OnError, err error) error {
case v1.Hook_ON_ERROR_RETRY_EXPONENTIAL_BACKOFF:
return &HookErrorRetry{Err: err, Backoff: func(attempt int) time.Duration {
d := time.Duration(math.Pow(2, float64(attempt-1))) * 10 * time.Second
if d > 1*time.Hour {
if attempt > 32 || d > 1*time.Hour {
return 1 * time.Hour
}
return d