mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 03:02:56 +08:00
Fix worker signal.SIGTERM handler being installed from outside the main thread (#6176)
This commit is contained in:
@@ -846,7 +846,11 @@ def sigterm_handler(signum, frame):
|
||||
sys.exit(signal.SIGTERM)
|
||||
|
||||
|
||||
signal.signal(signal.SIGTERM, sigterm_handler)
|
||||
try:
|
||||
signal.signal(signal.SIGTERM, sigterm_handler)
|
||||
except ValueError:
|
||||
logger.warning("Failed to set SIGTERM handler, processes might"
|
||||
"not be cleaned up properly on exit.")
|
||||
|
||||
# Define a custom excepthook so that if the driver exits with an exception, we
|
||||
# can push that exception to Redis.
|
||||
|
||||
Reference in New Issue
Block a user