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

    https://github.com/apache/spark/pull/10579#discussion_r48990874
  
    --- Diff: python/pyspark/context.py ---
    @@ -54,6 +54,64 @@
     }
     
     
    +class Py4jCallbackConnectionCleaner(object):
    +
    +    """
    +    A cleaner to clean up callback connections that are not closed by 
Py4j. See SPARK-12617.
    +    It will scan all callback connections every 30 seconds and close the 
dead connections.
    +    """
    +
    +    def __init__(self, gateway):
    +        self._gateway = gateway
    +        self._stopped = False
    +        self._timer = None
    +        self._lock = RLock()
    +
    +    def start(self):
    +        if self._stopped:
    +            return
    +
    +        def clean_closed_connections():
    +            from py4j.java_gateway import quiet_close, quiet_shutdown
    +
    +            callback_server = self._gateway._callback_server
    +            with callback_server.lock:
    --- End diff --
    
    Sorry that I didn't notice that only Streaming uses the callback server. I 
sent #10621 to fix it.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to