Skip to content

fix: localmode subprocess parent process not sending SIGTERM to child #2572

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

Merged
merged 6 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def read_version():
"urllib3>=1.21.1,!=1.25,!=1.25.1",
"docker-compose>=1.25.2",
"PyYAML>=5.3, <6", # PyYAML version has to match docker-compose requirements
"psutil",
],
"scipy": ["scipy>=0.19.0"],
}
Expand Down
5 changes: 5 additions & 0 deletions src/sagemaker/local/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
import tempfile

from distutils.spawn import find_executable
from signal import SIGTERM
from threading import Thread

import psutil
from six.moves.urllib.parse import urlparse

import sagemaker
Expand Down Expand Up @@ -840,6 +843,8 @@ def run(self):

def down(self):
"""Placeholder docstring"""
for process in psutil.Process(self.process.pid).children():
process.send_signal(SIGTERM)
self.process.terminate()


Expand Down