diff --git a/python/ray/_private/worker.py b/python/ray/_private/worker.py index 6b9f2e51f3497..da0378bc1587f 100644 --- a/python/ray/_private/worker.py +++ b/python/ray/_private/worker.py @@ -938,7 +938,7 @@ def main_loop(self): def sigterm_handler(signum, frame): raise_sys_exit_with_custom_error_message( - "The process receives a SIGTERM.", exit_code=1 + "The process received a SIGTERM", exit_code=1 ) # Note: shutdown() function is called from atexit handler. diff --git a/python/ray/_raylet.pyx b/python/ray/_raylet.pyx index 8fa091546078a..91793d5e09609 100644 --- a/python/ray/_raylet.pyx +++ b/python/ray/_raylet.pyx @@ -2368,12 +2368,13 @@ cdef CRayStatus task_execution_handler( # This means the system exit was # normal based on the python convention. # https://docs.python.org/3/library/sys.html#sys.exit - msg = f"Worker exits with an exit code {e.code}." + print("RETURNING FROM HERE!") + msg = f"The worker exited with exit code {e.code}." if hasattr(e, "ray_terminate_msg"): msg += (f" {e.ray_terminate_msg}") return CRayStatus.IntentionalSystemExit(msg) else: - msg = f"Worker exits with an exit code {e.code}." + msg = f"The worker exited with exit code {e.code}." # In K8s, SIGTERM likely means we hit memory limits, so print # a more informative message there. if "KUBERNETES_SERVICE_HOST" in os.environ: