Skip to content

select.select cannot be used for file descriptors > 1024 #5232

Description

@chrisburr

Copying from https://lblogbook.cern.ch/Operations/34170 as this is a bug in DIRAC.

The WorkloadManagement/Optimizers instances in LHCb started failing with:

2021-06-26 06:49:05 UTC WorkloadManagement/Optimizers ERROR: Exception while selecting persistent connections
Traceback (most recent call last):
 File "/opt/dirac/pro/DIRAC/Core/DISET/private/MessageBroker.py", line 151, in __listenAutoReceiveConnections
   inList, _outList, _exList = select.select([pos[1] for pos in sIdList], [], [], 1)
ValueError: filedescriptor out of range in select()

Looking into the cpython sources[1,2] it turns out this is a glibc limitation that file descriptors larger than 1024 can't be monitored with the select() system call and poll/epoll must be used instead.[3]

[1] https://github.com/python/cpython/blob/v2.7.18/Modules/selectmodule.c#L113-L119
[2] https://github.com/python/cpython/blob/v2.7.18/Include/fileobject.h#L89
[3] https://access.redhat.com/solutions/488623

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions