Skip to content

Commit d89486c

Browse files
Make timeouts constants
1 parent c24617c commit d89486c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/store/leaderelection/leaderelection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import (
6666

6767
const (
6868
JitterFactor = 1.2
69-
releaseTimeout = 15 * time.Second
69+
releaseTimeout = 10 * time.Second
7070
)
7171

7272
// NewLeaderElector creates a LeaderElector from a LeaderElectionConfig

pkg/store/lock.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ import (
1919
"k8s.io/client-go/tools/leaderelection/resourcelock"
2020
)
2121

22+
const (
23+
kubeLockerReleaseTimeout = 10 * time.Second
24+
)
25+
2226
// Locker is an interface for structs that can acquire and release locks.
2327
type Locker interface {
2428
// Acquire acquires the lock with the provided name.
@@ -192,7 +196,7 @@ func (k *KubeLocker) Release(name string) error {
192196
log.Infof("Waiting for lock to be released")
193197
releaseCtx, releaseCancel := context.WithTimeout(
194198
context.Background(),
195-
10*time.Second,
199+
kubeLockerReleaseTimeout,
196200
)
197201
defer releaseCancel()
198202

0 commit comments

Comments
 (0)