Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit b8a7557

Browse files
authored
Mention env var in PG creation timeout message (#261)
* Mention env var in PG creation timeout message Signed-off-by: Antoni Baum <antoni.baum@protonmail.com> * Print out seconds Signed-off-by: Antoni Baum <antoni.baum@protonmail.com> --------- Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
1 parent b7c3e7d commit b8a7557

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

xgboost_ray/main.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -878,16 +878,19 @@ def _create_placement_group(cpus_per_actor, gpus_per_actor,
878878
pg = placement_group(bundles, strategy=strategy)
879879
# Wait for placement group to get created.
880880
logger.debug("Waiting for placement group to start.")
881-
ready, _ = ray.wait([pg.ready()], timeout=ENV.PLACEMENT_GROUP_TIMEOUT_S)
881+
timeout = ENV.PLACEMENT_GROUP_TIMEOUT_S
882+
ready, _ = ray.wait([pg.ready()], timeout=timeout)
882883
if ready:
883884
logger.debug("Placement group has started.")
884885
else:
885-
raise TimeoutError("Placement group creation timed out. Make sure "
886-
"your cluster either has enough resources or use "
887-
"an autoscaling cluster. Current resources "
888-
"available: {}, resources requested by the "
889-
"placement group: {}".format(
890-
ray.available_resources(), pg.bundle_specs))
886+
raise TimeoutError(
887+
f"Placement group creation timed out after {timeout} seconds. "
888+
"Make sure your cluster either has enough resources or use "
889+
"an autoscaling cluster. Current resources "
890+
f"available: {ray.available_resources()}, resources requested "
891+
f"by the placement group: {pg.bundle_specs}. "
892+
"You can change the timeout by setting the "
893+
"RXGB_PLACEMENT_GROUP_TIMEOUT_S environment variable.")
891894
return pg
892895

893896

0 commit comments

Comments
 (0)