diff --git a/python/ray/_raylet.pyx b/python/ray/_raylet.pyx index 7783d9cc38a5..ccddfbe4f4ed 100644 --- a/python/ray/_raylet.pyx +++ b/python/ray/_raylet.pyx @@ -5154,6 +5154,10 @@ cdef void async_callback(shared_ptr[CRayObject] obj, user_callback = user_callback_ptr user_callback(result) + except Exception: + # Only log the error here because this calllback is called from Cpp + # and Cython will ignore the exception anyway + logger.exception(f"failed to run async callback (user func)") finally: # NOTE: we manually increment the Python reference count of the callback when # registering it in the core worker, so we must decrement here to avoid a leak.