Skip to content

Commit 19ddcdd

Browse files
Ken Takagiwagiwa
Ken Takagiwa
authored andcommitted
tried to restart callback server
1 parent c9fc124 commit 19ddcdd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

python/pyspark/java_gateway.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ def run(self):
7878
EchoOutputThread(proc.stdout).start()
7979

8080
# Connect to the gateway
81-
gateway = JavaGateway(GatewayClient(port=gateway_port), auto_convert=False, start_callback_server=True)
81+
# If start_callback_server is True, it looks like callback server is not killed
82+
# process is hang up and test case does not move forward.
83+
#gateway = JavaGateway(GatewayClient(port=gateway_port), auto_convert=False, start_callback_server=True)
84+
gateway = JavaGateway(GatewayClient(port=gateway_port), auto_convert=False, start_callback_server=False)
8285

8386
# Import the classes used by PySpark
8487
java_import(gateway.jvm, "org.apache.spark.SparkConf")

python/pyspark/streaming/context.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# limitations under the License.
1616
#
1717

18+
import time
19+
1820
from pyspark.conf import SparkConf
1921
from pyspark.files import SparkFiles
2022
from pyspark.java_gateway import launch_gateway
@@ -60,6 +62,12 @@ def __init__(self, master=None, appName=None, sparkHome=None, pyFiles=None,
6062
@param duration: A L{Duration} Duration for SparkStreaming
6163
6264
"""
65+
66+
# launch call back server
67+
if not gateway:
68+
gateway = launch_gateway()
69+
# gateway.restart_callback_server()
70+
6371
# Create the Python Sparkcontext
6472
self._sc = SparkContext(master=master, appName=appName, sparkHome=sparkHome,
6573
pyFiles=pyFiles, environment=environment, batchSize=batchSize,

0 commit comments

Comments
 (0)