kubernetes: Probe timeout ignored by ExecAction
I’m using a readiness probe that may take a long time to run, and I expected it to be interrupted after the specified timeout.
A probe defined like this:
"readinessProbe": {
"exec": {
"command": ["bash", "-c", "sleep 15"]
},
"timeoutSeconds": 5
}
Instead of timing out and failing, it is actually succeeding and ignoring the timeout.
I noticed that both TCPSocketAction
and HTTPGetAction
probes timeout according to the value of TimeoutSeconds
, ExecAction
on the other hand ignores it.
Looking at the code:
if p.Exec != nil
, no reference to timeout:
pkg/kubelet/prober/prober.go#L146
if p.HTTPGet != nil || p.TCPSocket != nil
, timeout is used:
pkg/kubelet/prober/prober.go#L163
pkg/kubelet/prober/prober.go#L171
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 32 (16 by maintainers)
Commits related to this issue
- Add timeout to Exec Readiness Probe Tested using: https://gist.github.com/dims/5c0a67b229f10a5bec7d0c32f27fb81d Fixes #26895 — committed to dims/kubernetes by dims 8 years ago
- Merge pull request #33366 from rhcarvalho/execincontainer-timeout-argument Automatic merge from submit-queue Add timeout argument to ExecInContainer <!-- Thanks for sending a pull request! Here a... — committed to kubernetes/kubernetes by deleted user 8 years ago
- Use timeout command to work around https://github.com/kubernetes/kubernetes/issues/26895 — committed to wallrj/navigator by wallrj 7 years ago
- [stable/rabbitmq-ha] Add liveness probe timeouts Set probe timeouts with the timeout binary instead of relying on timeout built into the probes in k8s, which are not respected by execAction See https... — committed to PaulFarver/charts by PaulFarver 4 years ago
- [stable/rabbitmq-ha] Add liveness probe timeouts (#21819) Set probe timeouts with the timeout binary instead of relying on timeout built into the probes in k8s, which are not respected by execAction ... — committed to helm/charts by PaulFarver 4 years ago
- [stable/rabbitmq-ha] Add liveness probe timeouts (#21819) Set probe timeouts with the timeout binary instead of relying on timeout built into the probes in k8s, which are not respected by execAction ... — committed to quantopian/charts by PaulFarver 4 years ago
- [stable/rabbitmq-ha] Add liveness probe timeouts (#21819) Set probe timeouts with the timeout binary instead of relying on timeout built into the probes in k8s, which are not respected by execAction ... — committed to includerandom/helm_charts by PaulFarver 4 years ago
- [stable/rabbitmq-ha] Add liveness probe timeouts (#21819) Set probe timeouts with the timeout binary instead of relying on timeout built into the probes in k8s, which are not respected by execAction ... — committed to li-adrienloiseau/charts by PaulFarver 4 years ago
- [stable/rabbitmq-ha] Add liveness probe timeouts (#21819) Set probe timeouts with the timeout binary instead of relying on timeout built into the probes in k8s, which are not respected by execAction ... — committed to Rungway/charts-we-use by PaulFarver 4 years ago
- [stable/rabbitmq-ha] Add liveness probe timeouts (#21819) Set probe timeouts with the timeout binary instead of relying on timeout built into the probes in k8s, which are not respected by execAction ... — committed to mmingorance-dh/charts by PaulFarver 4 years ago
/remove-lifecycle rotten
I’m still seeing this.
@tedyu thanks for fixing! I also ran into this 😦
For anyone looking for a workaround, I used the timeout command and it seems to have the intended effect.
That is, something like…