Commit be8b5f43 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#2847 refs[t:2847] panic the dbufio when an error occurs in the test

git-svn-id: file:///svn/toku/tokudb@22674 c7de825b-a66e-492c-adef-691d508d4ae1
parent 39b2d649
...@@ -31,6 +31,7 @@ static int loader_poll_callback(void *UU(extra), float UU(progress)) { ...@@ -31,6 +31,7 @@ static int loader_poll_callback(void *UU(extra), float UU(progress)) {
event_count++; event_count++;
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
r = TOKUDB_CANCELED; r = TOKUDB_CANCELED;
} else { } else {
r = 0; r = 0;
...@@ -43,6 +44,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre ...@@ -43,6 +44,7 @@ static size_t bad_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stre
size_t r; size_t r;
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = ENOSPC; errno = ENOSPC;
r = -1; r = -1;
} else { } else {
...@@ -59,6 +61,7 @@ static ssize_t bad_write(int fd, const void * bp, size_t len) { ...@@ -59,6 +61,7 @@ static ssize_t bad_write(int fd, const void * bp, size_t len) {
event_count++; event_count++;
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = ENOSPC; errno = ENOSPC;
r = -1; r = -1;
} else { } else {
...@@ -72,6 +75,7 @@ static ssize_t bad_pwrite(int fd, const void * bp, size_t len, toku_off_t off) { ...@@ -72,6 +75,7 @@ static ssize_t bad_pwrite(int fd, const void * bp, size_t len, toku_off_t off) {
event_count++; event_count++;
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = ENOSPC; errno = ENOSPC;
r = -1; r = -1;
} else { } else {
...@@ -86,6 +90,7 @@ bad_fdopen(int fd, const char * mode) { ...@@ -86,6 +90,7 @@ bad_fdopen(int fd, const char * mode) {
event_count++; event_count++;
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = EINVAL; errno = EINVAL;
rval = NULL; rval = NULL;
} else { } else {
...@@ -100,6 +105,7 @@ bad_fopen(const char *filename, const char *mode) { ...@@ -100,6 +105,7 @@ bad_fopen(const char *filename, const char *mode) {
event_count++; event_count++;
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = EINVAL; errno = EINVAL;
rval = NULL; rval = NULL;
} else { } else {
...@@ -115,6 +121,7 @@ bad_open(const char *path, int oflag, int mode) { ...@@ -115,6 +121,7 @@ bad_open(const char *path, int oflag, int mode) {
event_count++; event_count++;
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = EINVAL; errno = EINVAL;
rval = -1; rval = -1;
} else { } else {
...@@ -133,6 +140,7 @@ bad_fclose(FILE * stream) { ...@@ -133,6 +140,7 @@ bad_fclose(FILE * stream) {
rval = fclose(stream); rval = fclose(stream);
if (rval==0) { if (rval==0) {
if (event_count_trigger == event_count) { if (event_count_trigger == event_count) {
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = ENOSPC; errno = ENOSPC;
rval = -1; rval = -1;
} }
...@@ -181,6 +189,7 @@ static void *my_malloc(size_t n) { ...@@ -181,6 +189,7 @@ static void *my_malloc(size_t n) {
event_count++; event_count++;
if (event_count == event_count_trigger) { if (event_count == event_count_trigger) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = ENOMEM; errno = ENOMEM;
return NULL; return NULL;
} }
...@@ -206,6 +215,7 @@ static void *my_realloc(void *p, size_t n) { ...@@ -206,6 +215,7 @@ static void *my_realloc(void *p, size_t n) {
event_count++; event_count++;
if (event_count == event_count_trigger) { if (event_count == event_count_trigger) {
event_hit(); event_hit();
if (verbose) printf("%s %d\n", __FUNCTION__, event_count);
errno = ENOMEM; errno = ENOMEM;
return NULL; return NULL;
} }
...@@ -391,6 +401,8 @@ static void test (const char *directory, BOOL is_error) { ...@@ -391,6 +401,8 @@ static void test (const char *directory, BOOL is_error) {
if (r!=0) printf("%s:%d r=%d (%s)\n", __FILE__, __LINE__, r, errorstr_static(r)); if (r!=0) printf("%s:%d r=%d (%s)\n", __FILE__, __LINE__, r, errorstr_static(r));
assert(r==0); assert(r==0);
} }
if (r)
panic_dbufio_fileset(bfs, r);
} }
{ {
int r = queue_eof(q); int r = queue_eof(q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment