Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make timeouts in the Kubelet slightly offset to aid debugging #45110

Merged
merged 1 commit into from
May 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/kubelet/dockertools/kube_docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ var _ DockerInterface = &kubeDockerClient{}
// kubeDockerClient only applies timeout on non-long running operations.
const (
// defaultTimeout is the default timeout of short running docker operations.
defaultTimeout = 2 * time.Minute
// Value is slightly offset from 2 minutes to make timeouts due to this
// constant recognizable.
defaultTimeout = 2*time.Minute - 1*time.Second

// defaultShmSize is the default ShmSize to use (in bytes) if not specified.
defaultShmSize = int64(1024 * 1024 * 64)
Expand Down
4 changes: 3 additions & 1 deletion pkg/kubelet/rkt/rkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ const (
defaultNetworkName = "rkt.kubernetes.io"

// defaultRequestTimeout is the default timeout of rkt requests.
defaultRequestTimeout = 2 * time.Minute
// Value is slightly offset from 2 minutes to make timeouts due to this
// constant recognizable.
defaultRequestTimeout = 2*time.Minute - 1*time.Second
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mutually exclusive to the kubelet/dockertools one? Still seems like making it distinct would be nicer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two can't be running at the same time, so just assumed all runtime request timeouts could share this.


etcHostsPath = "/etc/hosts"
etcResolvConfPath = "/etc/resolv.conf"
Expand Down
4 changes: 3 additions & 1 deletion pkg/kubelet/volumemanager/volume_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const (
// will retry in the next sync iteration. This frees the associated
// goroutine of the pod to process newer updates if needed (e.g., a delete
// request to the pod).
podAttachAndMountTimeout time.Duration = 2 * time.Minute
// Value is slightly offset from 2 minutes to make timeouts due to this
// constant recognizable.
podAttachAndMountTimeout time.Duration = 2*time.Minute + 3*time.Second

// podAttachAndMountRetryInterval is the amount of time the GetVolumesForPod
// call waits before retrying
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const (

// maxDurationBeforeRetry is the maximum amount of time that
// durationBeforeRetry will grow to due to exponential backoff.
maxDurationBeforeRetry time.Duration = 2 * time.Minute
// Value is slightly offset from 2 minutes to make timeouts due to this
// constant recognizable.
maxDurationBeforeRetry time.Duration = 2*time.Minute + 2*time.Second
)

// ExponentialBackoff contains the last occurrence of an error and the duration
Expand Down
4 changes: 3 additions & 1 deletion pkg/util/goroutinemap/goroutinemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const (

// maxDurationBeforeRetry is the maximum amount of time that
// durationBeforeRetry will grow to due to exponential backoff.
maxDurationBeforeRetry = 2 * time.Minute
// Value is slightly offset from 2 minutes to make timeouts due to this
// constant recognizable.
maxDurationBeforeRetry = 2*time.Minute + 1*time.Second
)

// GoRoutineMap defines a type that can run named goroutines and track their
Expand Down