Skip to content

(torchx/local_scheduler) Use os.kill instead of os.killpg when sending SIGTERM to the replica pid. Add runner.wait() for torchx.runner.test.api_test#test_empty_session_id to gracefully wait for the replicas to finish running #1063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions torchx/runner/test/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def test_empty_session_id(self, _: MagicMock) -> None:
)

app_handle = runner.run(app, "local", self.cfg)
runner.wait(app_handle, wait_interval=0.1)

scheduler, session_name, app_id = parse_app_handle(app_handle)
self.assertEqual(scheduler, "local")
Expand Down
2 changes: 1 addition & 1 deletion torchx/schedulers/local_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def terminate(self) -> None:
"""
# safe to call terminate on a process that already died
try:
os.killpg(self.proc.pid, signal.SIGTERM)
os.kill(self.proc.pid, signal.SIGTERM)
except ProcessLookupError as e:
log.debug(f"Process {self.proc.pid} already got terminated")

Expand Down
Loading