Skip to content

Commit

Permalink
Add additional shutdown logging
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Nov 18, 2023
1 parent 9222041 commit 71b56a2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions workloads/IMDB_extended/run_repeating_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,19 @@ def noop(_signal, _frame):
query_order = query_order_main.copy()

# Signal that we're ready to start and wait for the controller.
print(f"Runner {runner_idx} is ready to start running.")
print(
f"Runner {runner_idx} is ready to start running.",
flush=True,
file=sys.stderr,
)
start_queue.put_nowait("")
control_semaphore.acquire() # type: ignore

while True:
# Note that `False` means to not block.
should_exit = control_semaphore.acquire(False) # type: ignore
if should_exit:
print(f"Runner {runner_idx} is exiting.")
print(f"Runner {runner_idx} is exiting.", file=sys.stderr, flush=True)
break

if execution_gap_dist is not None:
Expand Down Expand Up @@ -249,6 +253,7 @@ def noop(_signal, _frame):
os.fsync(file.fileno())
file.close()
database.close_sync()
print(f"Runner {runner_idx} has exited.", flush=True, file=sys.stderr)


def simulation_runner(
Expand Down Expand Up @@ -769,6 +774,9 @@ def signal_handler(_signal, _frame):
for p in processes:
p.join()

for idx, p in enumerate(processes):
print("Runner {idx} exit code:", p.exitcode, flush=True, file=sys.stderr)

print("Done repeating analytics!", flush=True, file=sys.stderr)


Expand Down

0 comments on commit 71b56a2

Please sign in to comment.