Skip to content

Commit 09f9908

Browse files
ranzviahsan-z-khanshreyapandit
authoredAug 30, 2021
fix: localmode subprocess parent process not sending SIGTERM to child (#2572)
Co-authored-by: Ahsan Khan <[email protected]> Co-authored-by: Shreya Pandit <[email protected]>
1 parent e87e988 commit 09f9908

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def read_version():
5252
"urllib3>=1.21.1,!=1.25,!=1.25.1",
5353
"docker-compose>=1.25.2",
5454
"PyYAML>=5.3, <6", # PyYAML version has to match docker-compose requirements
55+
"psutil",
5556
],
5657
"scipy": ["scipy>=0.19.0"],
5758
}

‎src/sagemaker/local/image.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
import tempfile
3232

3333
from distutils.spawn import find_executable
34+
from signal import SIGTERM
3435
from threading import Thread
36+
37+
import psutil
3538
from six.moves.urllib.parse import urlparse
3639

3740
import sagemaker
@@ -840,6 +843,8 @@ def run(self):
840843

841844
def down(self):
842845
"""Placeholder docstring"""
846+
for process in psutil.Process(self.process.pid).children():
847+
process.send_signal(SIGTERM)
843848
self.process.terminate()
844849

845850

0 commit comments

Comments
 (0)
Please sign in to comment.