mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
![]() When a Ray program first creates an ObjectRef (via ray.put or task call), we add it with a ref count of 0 in the C++ backend because the language frontend will increment the initial local ref once we return the allocated ObjectID, then delete the local ref once the ObjectRef goes out of scope. Thus, there is a brief window where the object ref will appear to be out of scope. This can cause problems with async protocols that check whether the object is in scope or not, such as the previous bug fixed in #19910. Now that we plan to enable lineage reconstruction to automatically recover lost objects, this race condition can also be problematic because we use the ref count to decide whether an object needs to be recovered or not. This PR avoids these race conditions by incrementing the local ref count in the C++ backend when executing ray.put() and task calls. The frontend is then responsible for skipping the initial local ref increment when creating the ObjectRef. This is the same fix used in #19910, but generalized to all initial ObjectRefs. This is a re-merge for #21719 with a fix for removing the owned object ref if creation fails. |
||
---|---|---|
.. | ||
api | ||
performance_test | ||
runtime | ||
serve | ||
test | ||
build-jar-multiplatform.sh | ||
BUILD.bazel | ||
checkstyle-suppressions.xml | ||
checkstyle.xml | ||
cleanup.sh | ||
dependencies.bzl | ||
generate_jni_header_files.sh | ||
pom.xml | ||
shade_rule | ||
test.sh | ||
testng.xml |