mirror of
https://github.com/wassname/ray.git
synced 2026-08-07 11:27:43 +08:00
[ray_client]: Insert decorators into the real ray module to allow for client mode (#13031)
This commit is contained in:
@@ -107,6 +107,10 @@ from ray.exceptions import (
|
||||
TaskCancelledError
|
||||
)
|
||||
from ray.utils import decode
|
||||
from ray._private.client_mode_hook import (
|
||||
_enable_client_hook,
|
||||
_disable_client_hook,
|
||||
)
|
||||
import msgpack
|
||||
|
||||
cimport cpython
|
||||
@@ -558,6 +562,7 @@ cdef CRayStatus task_execution_handler(
|
||||
|
||||
with gil:
|
||||
try:
|
||||
client_was_enabled = _disable_client_hook()
|
||||
try:
|
||||
# The call to execute_task should never raise an exception. If
|
||||
# it does, that indicates that there was an internal error.
|
||||
@@ -582,6 +587,8 @@ cdef CRayStatus task_execution_handler(
|
||||
else:
|
||||
logger.exception("SystemExit was raised from the worker")
|
||||
return CRayStatus.UnexpectedSystemExit()
|
||||
finally:
|
||||
_enable_client_hook(client_was_enabled)
|
||||
|
||||
return CRayStatus.OK()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user