wjszlachta-man commented on code in PR #53306:
URL: https://github.com/apache/spark/pull/53306#discussion_r2619945191
##########
python/pyspark/accumulators.py:
##########
@@ -266,12 +266,37 @@ def handle(self) -> None:
auth_token = self.server.auth_token # type: ignore[attr-defined]
def poll(func: Callable[[], bool]) -> None:
+ poller = None
+ if os.name == "posix":
+ # On posix systems use poll to avoid problems with file
descriptor
+ # numbers above 1024.
+ poller = select.poll()
+ poller.register(self.rfile, select.POLLIN)
+
while not self.server.server_shutdown: # type:
ignore[attr-defined]
# Poll every 1 second for new data -- don't block in case of
shutdown.
- r, _, _ = select.select([self.rfile], [], [], 1)
- if self.rfile in r and func():
+ r: set | list
+ if poller is not None:
+ r = set()
Review Comment:
I don't mind either way tbh - it shouldn't matter performance-wise, so
changed to `list` in latest commit.
--
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]