Commit efcaa1ef authored by Vasil Dimov's avatar Vasil Dimov

Cherry pick vasil.dimov@oracle.com-20101201140708-fsc5xlu9bkpov6pv

from mysql-trunk-innodb. The same problem also exists in 5.5.

  X revision-id: vasil.dimov@oracle.com-20101201140708-fsc5xlu9bkpov6pv
  X committer: Vasil Dimov <vasil.dimov@oracle.com>
  X branch nick: mysql-trunk-innodb
  X timestamp: Wed 2010-12-01 16:07:08 +0200
  X message:
  X   Fix Bug#58432 innodb.innodb_bug56143 fails under valgrind
  X   
  X   Use a longer timeout for semaphore waits if (possibly) running under
  X   Valgrind.
  X   
  X   Approved by:	Marko (via IRC)
parent 8903bae2
...@@ -923,12 +923,25 @@ sync_array_print_long_waits(void) ...@@ -923,12 +923,25 @@ sync_array_print_long_waits(void)
ulint fatal_timeout = srv_fatal_semaphore_wait_threshold; ulint fatal_timeout = srv_fatal_semaphore_wait_threshold;
ibool fatal = FALSE; ibool fatal = FALSE;
#ifdef UNIV_DEBUG_VALGRIND
/* Increase the timeouts if running under valgrind because it executes
extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that
we are running under valgrind but we have no better way to tell.
See Bug#58432 innodb.innodb_bug56143 fails under valgrind
for an example */
# define SYNC_ARRAY_TIMEOUT 2400
fatal_timeout *= 10;
#else
# define SYNC_ARRAY_TIMEOUT 240
#endif
for (i = 0; i < sync_primary_wait_array->n_cells; i++) { for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
cell = sync_array_get_nth_cell(sync_primary_wait_array, i); cell = sync_array_get_nth_cell(sync_primary_wait_array, i);
if (cell->wait_object != NULL && cell->waiting if (cell->wait_object != NULL && cell->waiting
&& difftime(time(NULL), cell->reservation_time) > 240) { && difftime(time(NULL), cell->reservation_time)
> SYNC_ARRAY_TIMEOUT) {
fputs("InnoDB: Warning: a long semaphore wait:\n", fputs("InnoDB: Warning: a long semaphore wait:\n",
stderr); stderr);
sync_array_cell_print(stderr, cell); sync_array_cell_print(stderr, cell);
...@@ -970,6 +983,8 @@ sync_array_print_long_waits(void) ...@@ -970,6 +983,8 @@ sync_array_print_long_waits(void)
" to the standard error stream\n"); " to the standard error stream\n");
} }
#undef SYNC_ARRAY_TIMEOUT
return(fatal); return(fatal);
} }
......
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