Warn the user when a nondeterministic task is detected. (#339)

* WARN instead of FATAL for object hash mismatches, push error to driver

* Document the callback signature for object_table_add/remove

* Error table

* Wait for all errors in python test

* Fix doc

* Fix state test
This commit is contained in:
Stephanie Wang
2017-03-07 00:32:15 -08:00
committed by Robert Nishihara
parent 0b8d279ef2
commit da06b4db82
15 changed files with 303 additions and 78 deletions
+23
View File
@@ -0,0 +1,23 @@
#include "error_table.h"
#include "redis.h"
void push_error(DBHandle *db_handle,
DBClientID driver_id,
int error_index,
size_t data_length,
unsigned char *data) {
CHECK(error_index >= 0 && error_index < MAX_ERROR_INDEX);
/* Allocate a struct to hold the error information. */
ErrorInfo *info = (ErrorInfo *) malloc(sizeof(ErrorInfo) + data_length);
info->driver_id = driver_id;
info->error_index = error_index;
info->data_length = data_length;
memcpy(info->data, data, data_length);
/* Generate a random key to identify this error message. */
CHECK(sizeof(info->error_key) >= UNIQUE_ID_SIZE);
UniqueID error_key = globally_unique_id();
memcpy(info->error_key, error_key.id, sizeof(info->error_key));
init_table_callback(db_handle, NIL_ID, __func__, info, NULL, NULL,
redis_push_error, NULL);
}