-
- Downloads
[SPARK-12511] [PYSPARK] [STREAMING] Make sure PythonDStream.registerSerializer is called only once
There is an issue that Py4J's PythonProxyHandler.finalize blocks forever. (https://github.com/bartdag/py4j/pull/184) Py4j will create a PythonProxyHandler in Java for "transformer_serializer" when calling "registerSerializer". If we call "registerSerializer" twice, the second PythonProxyHandler will override the first one, then the first one will be GCed and trigger "PythonProxyHandler.finalize". To avoid that, we should not call"registerSerializer" more than once, so that "PythonProxyHandler" in Java side won't be GCed. Author: Shixiong Zhu <shixiong@databricks.com> Closes #10514 from zsxwing/SPARK-12511.
Showing
- python/pyspark/streaming/context.py 25 additions, 8 deletionspython/pyspark/streaming/context.py
- python/pyspark/streaming/util.py 1 addition, 2 deletionspython/pyspark/streaming/util.py
- streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala 12 additions, 0 deletions...n/scala/org/apache/spark/streaming/StreamingContext.scala
Please register or sign in to comment