mirror of
https://github.com/wassname/ray.git
synced 2026-08-09 12:20:09 +08:00
Log fatal error if plasma manager or local scheduler heartbeats take too long. (#676)
* Log fatal error if plasma manager or local scheduler take too long to send heartbeat. * Fix linting. * Use int64_t for milliseconds since unix epoch.
This commit is contained in:
committed by
Philipp Moritz
parent
8317025987
commit
96962cdee0
@@ -79,7 +79,7 @@ function(define_test test_name library)
|
||||
add_executable(${test_name} test/${test_name}.cc ${ARGN})
|
||||
add_dependencies(${test_name} hiredis flatbuffers_ep)
|
||||
target_link_libraries(${test_name} common ${FLATBUFFERS_STATIC_LIB} ${library})
|
||||
target_compile_options(${test_name} PUBLIC "-DPLASMA_TEST -DLOCAL_SCHEDULER_TEST -DCOMMON_TEST -DRAY_COMMON_LOG_LEVEL=4 -DRAY_TIMEOUT=50")
|
||||
target_compile_options(${test_name} PUBLIC "-DPLASMA_TEST -DLOCAL_SCHEDULER_TEST -DCOMMON_TEST -DRAY_COMMON_LOG_LEVEL=4")
|
||||
endfunction()
|
||||
|
||||
define_test(common_tests "")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "common.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
@@ -65,3 +66,10 @@ char *ObjectID_to_string(ObjectID obj_id, char *id_string, int id_length) {
|
||||
|
||||
return id_string;
|
||||
}
|
||||
|
||||
int64_t current_time_ms() {
|
||||
std::chrono::milliseconds ms_since_epoch =
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch());
|
||||
return ms_since_epoch.count();
|
||||
}
|
||||
|
||||
@@ -232,4 +232,11 @@ bool DBClientID_equal(DBClientID first_id, DBClientID second_id);
|
||||
|
||||
extern const unsigned char NIL_DIGEST[DIGEST_SIZE];
|
||||
|
||||
/**
|
||||
* Return the current time in milliseconds since the Unix epoch.
|
||||
*
|
||||
* @return The number of milliseconds since the Unix epoch.
|
||||
*/
|
||||
int64_t current_time_ms();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user