Skip to content

Commit

Permalink
Fix None issue when no provision timeout is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Aug 16, 2024
1 parent 1c32aa4 commit 7b06620
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sky/provision/gcp/instance_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,16 +1081,17 @@ def create_instances(
run_duration=managed_instance_group_config['run_duration'])
cls.wait_for_operation(operation, project_id, zone=zone)

provision_timeout = managed_instance_group_config.get('provision_timeout')
if provision_timeout is None:
provision_timeout = constants.DEFAULT_MANAGED_INSTANCE_GROUP_PROVISION_TIMEOUT
# This will block the provisioning until the nodes are ready, which
# makes the failover not effective. We rely on the request timeout set
# by user to trigger failover.
mig_utils.wait_for_managed_group_to_be_stable(
project_id,
zone,
managed_instance_group_name,
timeout=managed_instance_group_config.get(
'provision_timeout',
constants.DEFAULT_MANAGED_INSTANCE_GROUP_PROVISION_TIMEOUT))
timeout=provision_timeout)

pending_running_instance_names = cls._add_labels_and_find_head(
cluster_name, project_id, zone, labels, potential_head_instances)
Expand Down

0 comments on commit 7b06620

Please sign in to comment.