Skip to content

Commit

Permalink
fix restarting
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Jul 5, 2024
1 parent 72bd0c6 commit 16379f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sky/provision/azure/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,7 @@ def _create_instance_tag(target_instance, is_head: bool = True) -> str:
_RESUME_PER_INSTANCE_TIMEOUT):
status = _get_instance_status(compute_client, inst,
resource_group)
if status in (AzureInstanceStatus.RUNNING,
AzureInstanceStatus.STOPPED):
if status == AzureInstanceStatus.STOPPED:
break
time.sleep(1)
else:
Expand All @@ -378,6 +377,8 @@ def _create_instance_tag(target_instance, is_head: bool = True) -> str:
'Retrying ...')
stopping_instances.append(inst)
time.sleep(5)
continue
stopped_instances.append(inst)
if stopping_instances and to_start_count > len(stopped_instances):
msg = ('Timeout for waiting for existing instances '
f'{stopping_instances} in STOPPING state to '
Expand Down

0 comments on commit 16379f1

Please sign in to comment.