ray/java
Stephanie Wang e3af828220
[core] Increment ref count when creating an ObjectRef to prevent object from going out of scope (#21719)
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.
2022-02-03 17:31:27 -08:00
..
api [Core] Support default actor lifetime. (#21283) 2022-01-22 12:26:08 +08:00
performance_test [Java] Remove auto-generated pom.xml files. (#19475) 2021-10-19 17:35:37 +08:00
runtime [core] Increment ref count when creating an ObjectRef to prevent object from going out of scope (#21719) 2022-02-03 17:31:27 -08:00
serve [Serve]Change Java LongPollClient's polling thread to singleton. (#20756) 2021-12-07 11:14:00 -08:00
test [CI] Format Python code with Black (#21975) 2022-01-29 18:41:57 -08:00
build-jar-multiplatform.sh Remove streaming deploying process. (#21603) 2022-01-17 23:37:48 +08:00
BUILD.bazel [Streaming]Farewell : remove all of streaming related from ray repo. (#21770) 2022-01-23 17:53:41 +08:00
checkstyle-suppressions.xml [Java] Format ray java code (#13056) 2020-12-29 10:36:16 +08:00
checkstyle.xml [Serve] Define BackendConfig protobuf and adapt it in Java (#17201) 2021-08-06 09:50:45 -07:00
cleanup.sh Shellcheck comments (#9595) 2020-07-21 16:47:09 -05:00
dependencies.bzl [Java] Bump log4j 2.17.0 to 2.17.1 (#21373) 2022-01-05 09:58:48 +08:00
generate_jni_header_files.sh Use javac -h instead of javah. (#19311) 2021-10-12 22:37:14 +08:00
pom.xml [Java] Fix typo projetct->project in XML file (#21060) 2021-12-20 20:21:35 +08:00
shade_rule [Java] Shade some widely used dependencies in bazel_jar_jar rule. (#21237) 2021-12-23 16:54:31 +08:00
test.sh [Java] Shade some widely used dependencies in bazel_jar_jar rule. (#21237) 2021-12-23 16:54:31 +08:00
testng.xml [Serve] Define Java Backend (#16169) 2021-07-01 20:41:17 -07:00