ray/src/common/state/error_table.cc
Robert Nishihara 4658d0a180 Print error when actor takes too long to start, and refactor error me… (#1747)
* 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.
2018-03-19 20:24:35 -07:00

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);
}