wjszlachta-man opened a new pull request, #53306:
URL: https://github.com/apache/spark/pull/53306
### What changes were proposed in this pull request?
On glibc based Linux systems `select()` can monitor only file descriptor
numbers that are less than `FD_SETSIZE` (1024).
This is an unreasonably low limit for many modern applications.
This PR replaces `select.select()` with `select.poll()` when running on
POSIX os.
### Why are the changes needed?
When running via `pyspark` we frequently observe:
```
Exception occurred during processing of request from ('127.0.0.1', 46334)
Traceback (most recent call last):
File "/usr/lib/python3.11/socketserver.py", line 317, in
_handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
self.handle()
File "/usr/lib/python3.11/site-packages/pyspark/accumulators.py", line
293, in handle
poll(authenticate_and_accum_updates)
File "/usr/lib/python3.11/site-packages/pyspark/accumulators.py", line
266, in poll
r, _, _ = select.select([self.rfile], [], [], 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: filedescriptor out of range in select()
```
On POSIX systems `poll()` should be used instead of `select()`.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Existing unit tests + we have been running this change (combined with
https://github.com/py4j/py4j/pull/560) on our YARN cluster (Linux) since April
2025.
### Was this patch authored or co-authored using generative AI tooling?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]