Skip to content

Commit f96cd4e

Browse files
author
Ken Takagiwa
committed
tried to restart callback server
1 parent fe86198 commit f96cd4e

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
@@ -76,7 +76,10 @@ def run(self):
7676
EchoOutputThread(proc.stdout).start()
7777

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

8184
# Import the classes used by PySpark
8285
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)