Skip to content

Commit

Permalink
[core] catch exception in async_callback (ray-project#46488)
Browse files Browse the repository at this point in the history
Signed-off-by: hongchaodeng <[email protected]>
  • Loading branch information
hongchaodeng committed Jul 9, 2024
1 parent 5874960 commit 6b98284
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/ray/_raylet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5169,6 +5169,10 @@ cdef void async_callback(shared_ptr[CRayObject] obj,

user_callback = <object>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.
Expand Down

0 comments on commit 6b98284

Please sign in to comment.