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

    https://github.com/apache/spark/pull/10579#discussion_r48934872
  
    --- 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 --
    
    Traceback (most recent call last):
      File "//anaconda/lib/python2.7/threading.py", line 810, in 
__bootstrap_inner
        self.run()
      File "//anaconda/lib/python2.7/threading.py", line 1082, in run
        self.function(*self.args, **self.kwargs)
      File "/Users/davies/work/spark/python/pyspark/context.py", line 78, in 
clean_closed_connections
        with callback_server.lock:
    AttributeError: 'NoneType' object has no attribute 'lock'


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to