-
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
ws_client.py uses select.poll without checking module existence #1686
Comments
@seanpang-vmware Thanks for reporting! Is select.poll only existing in linux / darwin platforms? If so, would you like to send a PR? |
No, the issue happened because eventlet is monkey patched, beause select.poll is not thread safe, so eventlet will remove this method after monkey patch. so calling this method will cause "No such module" excpetion. try this: import select select.poll() |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs 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 and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
When eventlet is monkey patched, select.poll is removed since it is not thread safe. So check availability of `poll` method before using it. Fixes: kubernetes-client#1753 Fixes: kubernetes-client#1686 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
/remove-lifecycle rotten |
/assign |
What happened (please include outputs or screenshots):
since version:
Kubernetes API Version: v1.21.7
Bug or Regression
Fixed #741, an issue which prevented Kubernetes cluster api-tokens from exec-plugin auth providers from being refreshed after expiry. (#250, @emenendez)
Use select.poll() for exec on linux/darwin to improve scalability of WSClient (#268, @jsun-splunk)
ws_client.py uses select.poll to exec but did not check if this module exist
if process is monkey patched, this will lead to ApiException.
What you expected to happen:
check if select.poll exist, if not use select.select instead.
/usr/local/lib/python3.8/dist-packages/kubernetes/stream/ws_client.py line 182
How to reproduce it (as minimally and precisely as possible):
A simple way to reproduce
root@192-161-133-176:/opt/vmware/nsx-cli/bin/python/cli# python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from eventlet issue page, this is a design intent:
eventlet/eventlet#608 (comment)
Anything else we need to know?:
Environment:
kubectl version
): 1.22python --version
) 3.8pip list | grep kubernetes
) 21.7.0The text was updated successfully, but these errors were encountered: