Skip to content

WSClient.update() fails on select.poll() when running in eventlet on Linux #1753

Closed
@bobh66

Description

@bobh66

What happened (please include outputs or screenshots):

WSClient.update() was modified by PR kubernetes-client/python-base#268 to use select.poll() instead of select.select, which breaks when running under eventlet on Linux:

File "/usr/local/lib/python3.8/site-packages/kubernetes/stream/ws_client.py", line 182, in update
poll = select.poll()
AttributeError: module 'select' has no attribute 'poll'
module 'select' has no attribute 'poll'

eventlet monkey_patches the select module and does not support the poll() method

Adding a check on getattr(select, "poll", None) is None to the if statement and reverting to select.select when there is no poll attribute will fix the problem.

I'll push a PR

What you expected to happen:

No exception should occur

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes version (kubectl version): 1.19, 1.21
  • OS (e.g., MacOS 10.13.6): CentOS 7
  • Python version (python --version) 3.8
  • Python client version (pip list | grep kubernetes) 23.3.0

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions