Skip to content

Commit ed83715

Browse files
authored
[spark] Refine some text in Ray on Spark exception messages and warning messages (ray-project#32162)
See follow-up comments in ray-project#31962 Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
1 parent 5091217 commit ed83715

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

python/ray/util/spark/cluster_init.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def wait_until_ready(self):
127127
# in this case, raise error directly.
128128
if self.background_job_exception is not None:
129129
raise RuntimeError(
130-
"Ray workers have exited."
130+
"Ray workers failed to start."
131131
) from self.background_job_exception
132132

133133
cur_alive_worker_count = (
@@ -406,6 +406,8 @@ def _setup_ray_cluster(
406406
ray_head_ip = socket.gethostbyname(get_spark_application_driver_host(spark))
407407
ray_head_port = get_random_unused_port(ray_head_ip, min_port=9000, max_port=10000)
408408

409+
# Make a copy for head_node_options to avoid changing original dict in user code.
410+
head_node_options = head_node_options.copy()
409411
include_dashboard = head_node_options.pop("include_dashboard", None)
410412
ray_dashboard_port = head_node_options.pop("dashboard_port", None)
411413

@@ -851,7 +853,7 @@ def setup_ray_cluster(
851853
collect their logs to the specified path. On Databricks Runtime, we
852854
recommend you to specify a local path starts with '/dbfs/', because the
853855
path mounts with a centralized storage device and stored data is persisted
854-
after databricks spark cluster terminated.
856+
after Databricks spark cluster terminated.
855857
856858
Returns:
857859
The address of the initiated Ray cluster on spark.

python/ray/util/spark/databricks_hook.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def on_cluster_created(self, ray_cluster_handler):
9393
_logger.warning(
9494
"Registering Ray cluster spark job as background job failed. "
9595
"You need to manually call `ray.util.spark.shutdown_ray_cluster()` "
96-
"before detaching your databricks notebook."
96+
"before detaching your Databricks notebook."
9797
)
9898

9999
auto_shutdown_minutes = float(
@@ -102,7 +102,7 @@ def on_cluster_created(self, ray_cluster_handler):
102102
if auto_shutdown_minutes == 0:
103103
_logger.info(
104104
"The Ray cluster will keep running until you manually detach the "
105-
"databricks notebook or call "
105+
"Databricks notebook or call "
106106
"`ray.util.spark.shutdown_ray_cluster()`."
107107
)
108108
return
@@ -117,26 +117,24 @@ def on_cluster_created(self, ray_cluster_handler):
117117
db_api_entry.getIdleTimeMillisSinceLastNotebookExecution()
118118
except Exception:
119119
_logger.warning(
120-
"Databricks `getIdleTimeMillisSinceLastNotebookExecution` API "
121-
"is unavailable, it is probably because that "
122-
"your current Databricks Runtime version does not support API "
123-
"`getIdleTimeMillisSinceLastNotebookExecution`, we cannot "
124-
"automatically shut down Ray cluster when databricks notebook "
125-
"is inactive, you need to manually detach databricks notebook "
120+
"Failed to retrieve idle time since last notebook execution, "
121+
"so that we cannot automatically shut down Ray cluster when "
122+
"Databricks notebook is inactive for the specified minutes. "
123+
"You need to manually detach Databricks notebook "
126124
"or call `ray.util.spark.shutdown_ray_cluster()` to shut down "
127125
"Ray cluster on spark."
128126
)
129127
return
130128

131129
_logger.info(
132130
"The Ray cluster will be shut down automatically if you don't run "
133-
"commands on the databricks notebook for "
131+
"commands on the Databricks notebook for "
134132
f"{auto_shutdown_minutes} minutes. You can change the "
135-
"automatically shutdown minutes by setting "
133+
"auto-shutdown minutes by setting "
136134
f"'{DATABRICKS_RAY_ON_SPARK_AUTOSHUTDOWN_MINUTES}' environment "
137135
"variable, setting it to 0 means that the Ray cluster keeps running "
138136
"until you manually call `ray.util.spark.shutdown_ray_cluster()` or "
139-
"detach databricks notebook."
137+
"detach Databricks notebook."
140138
)
141139

142140
def auto_shutdown_watcher():

0 commit comments

Comments
 (0)