Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] catch exception in async_callback #46488

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/ray/_raylet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5164,6 +5164,10 @@ cdef void async_callback(shared_ptr[CRayObject] obj,

user_callback = <object>user_callback_ptr
user_callback(result)
except Exception as e:
hongchaodeng marked this conversation as resolved.
Show resolved Hide resolved
# 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