Skip to content

Commit

Permalink
tried to restart callback server
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Takagiwa authored and giwa committed Sep 20, 2014
1 parent 9ab8952 commit 84a9668
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/pyspark/java_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def run(self):
EchoOutputThread(proc.stdout).start()

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

# Import the classes used by PySpark
java_import(gateway.jvm, "org.apache.spark.SparkConf")
Expand Down
8 changes: 8 additions & 0 deletions python/pyspark/streaming/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# limitations under the License.
#

import time

from pyspark.conf import SparkConf
from pyspark.files import SparkFiles
from pyspark.java_gateway import launch_gateway
Expand Down Expand Up @@ -60,6 +62,12 @@ def __init__(self, master=None, appName=None, sparkHome=None, pyFiles=None,
@param duration: A L{Duration} Duration for SparkStreaming
"""

# launch call back server
if not gateway:
gateway = launch_gateway()
# gateway.restart_callback_server()

# Create the Python Sparkcontext
self._sc = SparkContext(master=master, appName=appName, sparkHome=sparkHome,
pyFiles=pyFiles, environment=environment, batchSize=batchSize,
Expand Down

0 comments on commit 84a9668

Please sign in to comment.