Skip to content

Commit 1f1982a

Browse files
authored
[core] Delete event_label (ray-project#54378)
event_label is just macros mapping to strings that are only used in one spot. There really isn't a need for this, string literals are compile time constants anyways. Signed-off-by: dayshah <dhyey2019@gmail.com>
1 parent 4bf0001 commit 1f1982a

File tree

9 files changed

+6
-52
lines changed

9 files changed

+6
-52
lines changed

cpp/src/ray/runtime/task/task_executor.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "../../util/function_helper.h"
2222
#include "../abstract_ray_runtime.h"
2323
#include "ray/util/event.h"
24-
#include "ray/util/event_label.h"
2524

2625
namespace ray {
2726

@@ -211,7 +210,7 @@ Status TaskExecutor::ExecuteTask(
211210
if (status.IsIntentionalSystemExit()) {
212211
return status;
213212
} else {
214-
RAY_EVENT(ERROR, EL_RAY_CPP_TASK_FAILED)
213+
RAY_EVENT(ERROR, "RAY_CPP_TASK_FAILED")
215214
.WithField("task_type", TaskType_Name(task_type))
216215
.WithField("function_name", func_name)
217216
<< "C++ task failed: " << status.ToString();

src/ray/common/file_system_monitor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "ray/common/asio/instrumented_io_context.h"
2626
#include "ray/common/asio/periodical_runner.h"
2727
#include "ray/util/event.h"
28-
#include "ray/util/event_label.h"
2928

3029
namespace ray {
3130
/// Monitor the filesystem capacity ray is using.

src/ray/core_worker/transport/task_receiver.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ bool TaskReceiver::CancelQueuedNormalTask(TaskID task_id) {
269269
return normal_scheduling_queue_->CancelTaskIfFound(task_id);
270270
}
271271

272-
/// Note that this method is only used for asyncio actor.
273272
void TaskReceiver::SetupActor(bool is_asyncio,
274273
int fiber_max_concurrency,
275274
bool execute_out_of_order) {

src/ray/gcs/gcs_server/gcs_node_manager.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "ray/gcs/pb_util.h"
2626
#include "ray/stats/stats.h"
2727
#include "ray/util/event.h"
28-
#include "ray/util/event_label.h"
2928
#include "ray/util/logging.h"
3029
#include "src/ray/protobuf/gcs.pb.h"
3130

@@ -408,7 +407,7 @@ std::shared_ptr<rpc::GcsNodeInfo> GcsNodeManager::RemoveNode(
408407
<< " has missed too many heartbeats from it. This can happen when a "
409408
"\t(1) raylet crashes unexpectedly (OOM, etc.) \n"
410409
<< "\t(2) raylet has lagging heartbeats due to slow network or busy workload.";
411-
RAY_EVENT(ERROR, EL_RAY_NODE_REMOVED)
410+
RAY_EVENT(ERROR, "RAY_NODE_REMOVED")
412411
.WithField("node_id", node_id.Hex())
413412
.WithField("ip", removed_node->node_manager_address())
414413
<< error_message.str();

src/ray/raylet/node_manager.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include "ray/stats/metric_defs.h"
5151
#include "ray/util/cmd_line_utils.h"
5252
#include "ray/util/event.h"
53-
#include "ray/util/event_label.h"
5453
#include "ray/util/util.h"
5554

5655
namespace {
@@ -1455,7 +1454,7 @@ void NodeManager::DisconnectClient(const std::shared_ptr<ClientConnection> &clie
14551454
<< rpc::WorkerExitType_Name(disconnect_type)
14561455
<< " Worker exit detail: " << disconnect_detail;
14571456
std::string error_message_str = error_message.str();
1458-
RAY_EVENT(ERROR, EL_RAY_WORKER_FAILURE)
1457+
RAY_EVENT(ERROR, "RAY_WORKER_FAILURE")
14591458
.WithField("worker_id", worker->WorkerId().Hex())
14601459
.WithField("node_id", self_node_id_.Hex())
14611460
.WithField("job_id", worker->GetAssignedJobId().Hex())
@@ -1484,7 +1483,7 @@ void NodeManager::DisconnectClient(const std::shared_ptr<ClientConnection> &clie
14841483
RAY_LOG(INFO).WithField(worker->WorkerId()).WithField(worker->GetAssignedJobId())
14851484
<< "Driver (pid=" << worker->GetProcess().GetId() << ") is disconnected.";
14861485
if (disconnect_type == rpc::WorkerExitType::SYSTEM_ERROR) {
1487-
RAY_EVENT(ERROR, EL_RAY_DRIVER_FAILURE)
1486+
RAY_EVENT(ERROR, "RAY_DRIVER_FAILURE")
14881487
.WithField("node_id", self_node_id_.Hex())
14891488
.WithField("job_id", worker->GetAssignedJobId().Hex())
14901489
<< "Driver " << worker->WorkerId() << " died. Address: " << worker->IpAddress()

src/ray/util/BUILD

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ ray_cc_library(
1010
hdrs = ["macros.h"],
1111
)
1212

13-
ray_cc_library(
14-
name = "event_label",
15-
hdrs = ["event_label.h"],
16-
)
17-
1813
ray_cc_library(
1914
name = "array",
2015
hdrs = ["array.h"],
@@ -52,7 +47,6 @@ ray_cc_library(
5247
srcs = ["logging.cc"],
5348
hdrs = ["logging.h"],
5449
deps = [
55-
":event_label",
5650
":macros",
5751
":string_utils",
5852
":thread_utils",

src/ray/util/event_label.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/ray/util/logging.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "absl/debugging/symbolize.h"
4545
#include "absl/strings/numbers.h"
4646
#include "absl/strings/str_format.h"
47-
#include "ray/util/event_label.h"
4847
#include "ray/util/string_utils.h"
4948
#include "ray/util/thread_utils.h"
5049
#include "spdlog/sinks/basic_file_sink.h"
@@ -592,7 +591,7 @@ RayLog::~RayLog() {
592591
msg_osstream_ << "\n*** StackTrace Information ***\n" << ray::StackTrace();
593592
expose_fatal_osstream_ << "\n*** StackTrace Information ***\n" << ray::StackTrace();
594593
for (const auto &callback : fatal_log_callbacks_) {
595-
callback(EL_RAY_FATAL_CHECK_FAILED, expose_fatal_osstream_.str());
594+
callback("RAY_FATAL_CHECK_FAILED", expose_fatal_osstream_.str());
596595
}
597596
}
598597

src/ray/util/tests/event_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <vector>
3030

3131
#include "ray/common/ray_config.h"
32-
#include "ray/util/event_label.h"
3332
#include "ray/util/random.h"
3433
#include "ray/util/string_utils.h"
3534
#include "src/ray/protobuf/gcs.pb.h"
@@ -592,7 +591,7 @@ TEST_F(EventTest, TestRayCheckAbort) {
592591
"task 1",
593592
"RAYLET",
594593
"FATAL",
595-
EL_RAY_FATAL_CHECK_FAILED,
594+
"RAY_FATAL_CHECK_FAILED",
596595
"NULL");
597596
EXPECT_THAT(ele_1.message(),
598597
testing::HasSubstr("Check failed: 1 < 0 incorrect test case"));

0 commit comments

Comments
 (0)