mirror of
https://github.com/vale981/ray
synced 2025-03-12 06:06:39 -04:00

* Print error when actor takes too long to start, and refactor error message pushing. * Print warning every ten seconds. * Fix linting and tests. * Fix tests.
24 lines
906 B
C++
24 lines
906 B
C++
#include "error_table.h"
|
|
#include "redis.h"
|
|
|
|
const char *error_types[] = {"object_hash_mismatch", "put_reconstruction",
|
|
"worker_died", "actor_not_created"};
|
|
|
|
void push_error(DBHandle *db_handle,
|
|
DBClientID driver_id,
|
|
int error_type,
|
|
const std::string &error_message) {
|
|
int64_t message_size = error_message.size();
|
|
|
|
/* Allocate a struct to hold the error information. */
|
|
ErrorInfo *info = (ErrorInfo *) malloc(sizeof(ErrorInfo) + message_size);
|
|
info->driver_id = driver_id;
|
|
info->error_type = error_type;
|
|
info->error_key = UniqueID::from_random();
|
|
info->size = message_size;
|
|
memcpy(info->error_message, error_message.data(), message_size);
|
|
|
|
init_table_callback(db_handle, UniqueID::nil(), __func__,
|
|
new CommonCallbackData(info), NULL, NULL,
|
|
redis_push_error, NULL);
|
|
}
|