[core] Fix some legacy issues (#19392)

## Why are these changes needed?
There are some issues left from previous PRs.

- Put the gcs_actor_scheduler_mock_test back
- Add comment for named actor creation behavior
- Fix the comment for some flags. 

## Related issue number
This commit is contained in:
Yi Cheng 2021-10-15 18:06:01 -07:00 committed by GitHub
parent a9c34d55e3
commit a3dc07b1ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 17 deletions

View file

@ -1531,20 +1531,20 @@ cc_test(
],
)
# cc_test(
# name = "gcs_actor_scheduler_mock_test",
# size = "small",
# srcs = [
# "src/ray/gcs/gcs_server/test/gcs_actor_scheduler_mock_test.cc",
# ],
# copts = COPTS,
# tags = ["team:core"],
# deps = [
# ":gcs_server_lib",
# ":ray_mock",
# "@com_google_googletest//:gtest_main",
# ],
# )
cc_test(
name = "gcs_actor_scheduler_mock_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_actor_scheduler_mock_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_based_actor_scheduler_test",

View file

@ -477,7 +477,11 @@ RAY_CONFIG(int64_t, grpc_keepalive_timeout_ms, 20000);
/// Whether to use log reporter in event framework
RAY_CONFIG(bool, event_log_reporter_enabled, true)
/// Whether to use log reporter in event framework
/// Whether to enable register actor async.
/// If it is false, the actor registration to GCS becomes synchronous, i.e.,
/// core worker is blocked until GCS registers the actor and replies to it.
/// If it is true, the actor registration is async, but actor handles cannot
/// be passed to other worker until it is registered to GCS.
RAY_CONFIG(bool, actor_register_async, true)
/// Event severity threshold value

View file

@ -1800,6 +1800,9 @@ Status CoreWorker::CreateActor(const RayFunction &function,
},
"ActorCreator.AsyncRegisterActor");
} else {
// For named actor, we still go through the sync way because for
// functions like list actors these actors need to be there, especially
// for local driver. But the current code all go through the gcs right now.
auto status = actor_creator_->RegisterActor(task_spec);
if (!status.ok()) {
return status;

View file

@ -84,7 +84,7 @@ TEST_F(GcsActorSchedulerTest, KillWorkerLeak1) {
actor_data.set_actor_id(actor_id.Binary());
auto actor = std::make_shared<GcsActor>(actor_data);
std::function<void(const Status &, const rpc::RequestWorkerLeaseReply &)> cb;
EXPECT_CALL(*raylet_client, RequestWorkerLease(Matcher<const rpc::TaskSpec &>(), _, _))
EXPECT_CALL(*raylet_client, RequestWorkerLease(An<const rpc::TaskSpec &>(), _, _))
.WillOnce(testing::SaveArg<1>(&cb));
// Ensure actor is killed
EXPECT_CALL(*core_worker_client, KillActor(_, _));
@ -113,7 +113,7 @@ TEST_F(GcsActorSchedulerTest, KillWorkerLeak2) {
rpc::ClientCallback<rpc::RequestWorkerLeaseReply> request_worker_lease_cb;
// Ensure actor is killed
EXPECT_CALL(*core_worker_client, KillActor(_, _));
EXPECT_CALL(*raylet_client, RequestWorkerLease(Matcher<const rpc::TaskSpec &>(), _, _))
EXPECT_CALL(*raylet_client, RequestWorkerLease(An<const rpc::TaskSpec &>(), _, _))
.WillOnce(testing::SaveArg<1>(&request_worker_lease_cb));
std::function<void(ray::Status)> async_put_with_index_cb;