From f7940e407a373d018e70efe25f37b1a8b9318f03 Mon Sep 17 00:00:00 2001 From: Aditya A Date: Mon, 29 Jul 2013 14:45:06 +0530 Subject: [PATCH] Bug#13417564 SKIP SLEEP IN SRV_MASTER_THREAD WHEN SHUTDOWN IS IN PROGRESS PROBLEM ------- In the background thread srv_master_thread() we have a a one second delay loop which will continuously monitor server activity .If the server is inactive (with out any user activity) or in a shutdown state we do some background activity like flushing the changes.In the current code we are not checking if server is in shutdown state before sleeping for one second. FIX --- If server is in shutdown state ,then dont go to one second sleep. --- storage/innobase/srv/srv0srv.c | 4 ++-- storage/innodb_plugin/srv/srv0srv.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index e5619abbe45..f615384777c 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -2432,7 +2432,7 @@ loop: by x100 (1purge/100msec), to speed up debug scripts which should wait for purged. */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(100000); } @@ -2448,7 +2448,7 @@ loop: } while (n_pages_purged); } else #endif /* UNIV_DEBUG */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(1000000); } diff --git a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c index f27f9e37c31..a54a8088a9b 100644 --- a/storage/innodb_plugin/srv/srv0srv.c +++ b/storage/innodb_plugin/srv/srv0srv.c @@ -2518,7 +2518,7 @@ loop: by x100 (1purge/100msec), to speed up debug scripts which should wait for purged. */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(100000); srv_main_sleeps++; } @@ -2535,7 +2535,7 @@ loop: } while (n_pages_purged); } else #endif /* UNIV_DEBUG */ - if (!skip_sleep) { + if (!skip_sleep && !srv_shutdown_state) { os_thread_sleep(1000000); srv_main_sleeps++;