summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2021-03-08 13:13:14 +1100
committerDaniel Black <daniel@mariadb.org>2021-03-22 09:51:12 +1100
commit5db42038e8349dbac9454f8c0eb95e462c5662e9 (patch)
tree8d5f7b717ce8739690e0eec1878835cefd453e14
parent81b5e7dd68e0201a00be2c9eee714b37d456dcc4 (diff)
downloadmariadb-git-bb-10.6-danielblack-valgrind-test-real-shutdown-path.tar.gz
purge HAVE_CLOSE_SERVER_SOCK from sql/mysqld.ccbb-10.6-danielblack-valgrind-test-real-shutdown-path
When we are testing under valgrind, we should be testing the actual code path used in production code. This optimization of using shutdown did, in pre-2009, help purify shutdown quickly. In b125770aaadd09e839ad9211047e88095984308b this magicly equated to valgrind, in 2009.
-rw-r--r--sql/mysqld.cc43
1 files changed, 0 insertions, 43 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 297a2fc7043..4f522d96a9f 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -132,11 +132,6 @@
#define mysqld_charset &my_charset_latin1
-/* We have HAVE_valgrind below as this speeds up the shutdown of MySQL */
-
-#if defined(HAVE_valgrind) && defined(__linux__)
-#define HAVE_CLOSE_SERVER_SOCK 1
-#endif
extern "C" { // Because of SCO 3.2V4.2
#include <sys/stat.h>
@@ -1493,7 +1488,6 @@ static int test_if_case_insensitive(const char *dir_name);
static bool pid_file_created= false;
static void usage(void);
static void start_signal_handler(void);
-static void close_server_sock();
static void clean_up_mutexes(void);
static void wait_for_signal_thread_to_end(void);
static void create_pid_file();
@@ -1633,7 +1627,6 @@ static void break_connect_loop()
if (error != 0 && error != ETIMEDOUT && !count++)
sql_print_error("Got error %d from mysql_cond_timedwait", error);
#endif
- close_server_sock();
}
mysql_mutex_unlock(&LOCK_start_thread);
#endif /* __WIN__ */
@@ -1770,42 +1763,6 @@ static void close_connections(void)
DBUG_VOID_RETURN;
}
-
-#ifdef HAVE_CLOSE_SERVER_SOCK
-static void close_socket(MYSQL_SOCKET sock, const char *info)
-{
- DBUG_ENTER("close_socket");
-
- DBUG_PRINT("info", ("calling shutdown on %s socket", info));
- (void) mysql_socket_shutdown(sock, SHUT_RDWR);
- DBUG_VOID_RETURN;
-}
-#endif
-
-
-static void close_server_sock()
-{
-#ifdef HAVE_CLOSE_SERVER_SOCK
- DBUG_ENTER("close_server_sock");
-
- mysql_mutex_assert_owner(&LOCK_start_thread);
- for (uint i= 0 ; i < listen_sockets.elements() ; i++)
- {
- MYSQL_SOCKET *sock= listen_sockets.get_pos(i);
- if (sock->is_unix_domain_socket)
- {
- close_socket(*sock, "unix/IP");
- (void) unlink(mysqld_unix_port);
- }
- else
- close_socket(*sock, "TCP/IP");
- }
- listen_sockets.free_memory();
-
- DBUG_VOID_RETURN;
-#endif
-}
-
#endif /*EMBEDDED_LIBRARY*/