[Core] v1: Use atexit to handle engine core client shutdown (#11076)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2024-12-11 04:26:36 -05:00
committed by GitHub
parent 9974fca047
commit 61b1d2f6ae

View File

@@ -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.