-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
ERROR_CHANNEL of websocket client is empty when a timeout occurs #2156
Comments
CC @iciclespider. Could you take a look? |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Hi all, I got the same problem while running custom scripts against a container. My code looks similar: s = stream(
k.connect_get_namespaced_pod_exec,
pod_name,
namespace=namespace,
container=container,
command=command,
stderr=True,
stdin=False,
stdout=True,
tty=False,
_preload_content=False,
)
while s.is_open():
s.update(timeout=1)
if s.peek_stdout() or s.peek_stderr():
# do some logging
if s.returncode:
print(f"Command failed: exit code {s.returncode}") Even if the /remove-lifecycle rotten |
As a side note: I was not be able to reproduce this issue when running a command which does not return successfully, e.g. /remove-lifecycle rotten |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
What happened:
If a timeout happens when steaming exec command, the websocket client simply stops reading, and the ERROR_CHANNEL becomes empty if the exec command is not finished. Then if one tries to read the
returncode
property of the client, aTypeError
will be raised:What you expected to happen:
A
TimeoutException
being raised, or a property on the client to query the timeout stateHow to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Here are some snippets from kubelet, it looks to me that the Status channel is only written when the execution in container finishes:
Environment:
kubectl version
): v1.24.17-eks-4f4795dpython --version
): Python 3.11.6 [GCC 12.2.0]pip list | grep kubernetes
): 27.2.0The text was updated successfully, but these errors were encountered: