Open
Description
What is the problem?
The string generated by GenerateUniqueBytes
is not really unique.
Lines 40 to 53 in 0178d63
Ray version and other system information (Python version, TensorFlow version, OS): 1.0.1
Reproduction (REQUIRED)
Apply below patch and run bazel run //:id_test
,
diff --git a/src/ray/common/id_test.cc b/src/ray/common/id_test.cc
index 926e6fbd11..f1274d92a5 100644
--- a/src/ray/common/id_test.cc
+++ b/src/ray/common/id_test.cc
@@ -51,6 +51,15 @@ TEST(ActorIDTest, TestActorID) {
const ActorID actor_id = ActorID::Of(kDefaultJobId, kDefaultDriverTaskId, 1);
ASSERT_EQ(kDefaultJobId, actor_id.JobId());
}
+
+ {
+ // test no duplicated ID
+ std::unordered_set<ActorID> ids;
+ for (size_t i = 0; i < 1000000; i++) {
+ auto id = ActorID::Of(kDefaultJobId, kDefaultDriverTaskId, i);
+ RAY_CHECK(ids.insert(id).second) << "Duplicated ID generated: " << id;
+ }
+ }
}
TEST(TaskIDTest, TestTaskID) {
You will see the error:
[2020-11-20 05:37:07,442 C 104416 104416] id_test.cc:60: Check failed: ids.insert(id).second Duplicated ID generated: 584a7e60c7000000
If we cannot run your script, we cannot fix your issue.
- I have verified my script runs in a clean environment and reproduces the issue.
- I have verified the issue also occurs with the latest wheels.