Skip to content

Commit

Permalink
fix sky status pool wait
Browse files Browse the repository at this point in the history
  • Loading branch information
cblmemo committed Nov 3, 2023
1 parent 2008590 commit ad40472
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1915,17 +1915,6 @@ def _try_get_future_result(future) -> Tuple[bool, Any]:
# down, and the hint for showing sky spot queue
# will still be shown.
success = False

try:
pool.close()
pool.join()
except SystemExit as e:
# This is to avoid a "Exception ignored" problem caused by
# ray worker setting the sigterm handler to sys.exit(15)
# (see ray/_private/worker.py).
# TODO (zhwu): Remove any importing of ray in SkyPilot.
if e.code != 15:
raise
return success, result

spot_jobs_success = True
Expand Down Expand Up @@ -1973,7 +1962,19 @@ def _try_get_future_result(future) -> Tuple[bool, Any]:
success, msg = _try_get_future_result(services_future)
if not success:
msg = 'KeyboardInterrupt'
click.echo(msg)
click.echo(msg)

if show_spot_jobs or show_services:
try:
pool.close()
pool.join()
except SystemExit as e:
# This is to avoid a "Exception ignored" problem caused by
# ray worker setting the sigterm handler to sys.exit(15)
# (see ray/_private/worker.py).
# TODO (zhwu): Remove any importing of ray in SkyPilot.
if e.code != 15:
raise

if num_pending_autostop > 0 and not refresh:
# Don't print this hint if there's no pending autostop or user has
Expand Down

0 comments on commit ad40472

Please sign in to comment.