summaryrefslogtreecommitdiff
path: root/storage/innobase/sync/sync0arr.c
diff options
context:
space:
mode:
authorVasil Dimov <vasil.dimov@oracle.com>2010-12-03 09:35:53 +0200
committerVasil Dimov <vasil.dimov@oracle.com>2010-12-03 09:35:53 +0200
commitefcaa1ef7f8b67a625070f4b34cb78912da3d378 (patch)
tree3b0b98e19e5f5827699ca1979c61bfc451fbb543 /storage/innobase/sync/sync0arr.c
parent8903bae21abe2b6747f52fd074aff8d9e604ee5a (diff)
downloadmariadb-git-efcaa1ef7f8b67a625070f4b34cb78912da3d378.tar.gz
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)
Diffstat (limited to 'storage/innobase/sync/sync0arr.c')
-rw-r--r--storage/innobase/sync/sync0arr.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
index b7e8206b575..ce9d42c4921 100644
--- a/storage/innobase/sync/sync0arr.c
+++ b/storage/innobase/sync/sync0arr.c
@@ -923,12 +923,25 @@ sync_array_print_long_waits(void)
ulint fatal_timeout = srv_fatal_semaphore_wait_threshold;
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++) {
cell = sync_array_get_nth_cell(sync_primary_wait_array, i);
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",
stderr);
sync_array_cell_print(stderr, cell);
@@ -970,6 +983,8 @@ sync_array_print_long_waits(void)
" to the standard error stream\n");
}
+#undef SYNC_ARRAY_TIMEOUT
+
return(fatal);
}