Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1643#discussion_r15602183
  
    --- Diff: python/pyspark/daemon.py ---
    @@ -50,6 +54,43 @@ def compute_real_exit_code(exit_code):
             return 1
     
     
    +def check_socket(sockets):
    +    fds = [sock.fileno() for _, sock in sockets]
    +    # poll all the sockets check if some of them were closed
    +    avail_fds = select.select(fds, [], [], 1)[0]
    +
    +    for fd in avail_fds:
    +        pid, sock = sockets[fds.index(fd)]
    +        try:
    +            n = sock.recv(1, socket.MSG_PEEK | socket.MSG_DONTWAIT)
    --- End diff --
    
    In most cases, there is no exception, recv() will return 0.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to