Thanks to visit codestin.com
Credit goes to github.com

Skip to content

active log streaming times out after 5 minutes #9013

@brenton

Description

@brenton

I noticed that if I'm following a pod log that is being actively written to it will timeout after 5 minutes. However if the pod is not writing logs the request will not timeout. In that case the request will remain open seemingly indefinitely.

I can change the behavior by modifying this line of code:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/kubelet/server.go#L68

To make it happen faster you can set the value lower. I've been testing with 1 minute.

Steps to reproduce:

  1. Launch cluster
  2. Create the nginx pod in examples/pod.yaml
  3. In another terminal generate log output by hitting the pod: while :; do curl 172.17.0.22; sleep 0.5; done (you'll need to change the ip).
  4. Watch the logs: time curl -ivs --raw "http://127.0.0.1:8080/api/v1beta3/namespaces/default/pods/nginx/log?container=nginx&follow=true&previous=false"

In this case whenever the WriteTimeout is reached curl will receive the zero sized chunk and the connection will be closed. If you leave out step 3 curl will continue seemingly indefinitely.

This behavior definitely seems odd. Is the usage of WriteTimeout correct here? A quick search shows that others have been confused by the intention of WriteTimeout which is why I ask.

Metadata

Metadata

Assignees

Labels

area/apiserverkind/bugCategorizes issue or PR as related to a bug.priority/backlogHigher priority than priority/awaiting-more-evidence.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions