[Core] v1: Use atexit to handle engine core client shutdown (#11076)
Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import atexit
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
@@ -157,6 +158,7 @@ class MPClient(EngineCoreClient):
|
|||||||
should_shutdown=self.should_shutdown,
|
should_shutdown=self.should_shutdown,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
atexit.register(self.shutdown)
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
# Send shutdown signal to background process.
|
# Send shutdown signal to background process.
|
||||||
|
|||||||
Reference in New Issue
Block a user