Skip to content

Commit 2e31b2f

Browse files
committed
purge HAVE_CLOSE_SERVER_SOCK from sql/mysqld.cc
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 b125770 this magicly equated to valgrind, in 2009. Reviewer: Monty
1 parent 1170794 commit 2e31b2f

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

sql/mysqld.cc

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,6 @@
132132

133133
#define mysqld_charset &my_charset_latin1
134134

135-
/* We have HAVE_valgrind below as this speeds up the shutdown of MySQL */
136-
137-
#if defined(HAVE_valgrind) && defined(__linux__)
138-
#define HAVE_CLOSE_SERVER_SOCK 1
139-
#endif
140135

141136
extern "C" { // Because of SCO 3.2V4.2
142137
#include <sys/stat.h>
@@ -1493,7 +1488,6 @@ static int test_if_case_insensitive(const char *dir_name);
14931488
static bool pid_file_created= false;
14941489
static void usage(void);
14951490
static void start_signal_handler(void);
1496-
static void close_server_sock();
14971491
static void clean_up_mutexes(void);
14981492
static void wait_for_signal_thread_to_end(void);
14991493
static void create_pid_file();
@@ -1633,7 +1627,6 @@ static void break_connect_loop()
16331627
if (error != 0 && error != ETIMEDOUT && !count++)
16341628
sql_print_error("Got error %d from mysql_cond_timedwait", error);
16351629
#endif
1636-
close_server_sock();
16371630
}
16381631
mysql_mutex_unlock(&LOCK_start_thread);
16391632
#endif /* __WIN__ */
@@ -1770,42 +1763,6 @@ static void close_connections(void)
17701763
DBUG_VOID_RETURN;
17711764
}
17721765

1773-
1774-
#ifdef HAVE_CLOSE_SERVER_SOCK
1775-
static void close_socket(MYSQL_SOCKET sock, const char *info)
1776-
{
1777-
DBUG_ENTER("close_socket");
1778-
1779-
DBUG_PRINT("info", ("calling shutdown on %s socket", info));
1780-
(void) mysql_socket_shutdown(sock, SHUT_RDWR);
1781-
DBUG_VOID_RETURN;
1782-
}
1783-
#endif
1784-
1785-
1786-
static void close_server_sock()
1787-
{
1788-
#ifdef HAVE_CLOSE_SERVER_SOCK
1789-
DBUG_ENTER("close_server_sock");
1790-
1791-
mysql_mutex_assert_owner(&LOCK_start_thread);
1792-
for (uint i= 0 ; i < listen_sockets.elements() ; i++)
1793-
{
1794-
MYSQL_SOCKET *sock= listen_sockets.get_pos(i);
1795-
if (sock->is_unix_domain_socket)
1796-
{
1797-
close_socket(*sock, "unix/IP");
1798-
(void) unlink(mysqld_unix_port);
1799-
}
1800-
else
1801-
close_socket(*sock, "TCP/IP");
1802-
}
1803-
listen_sockets.free_memory();
1804-
1805-
DBUG_VOID_RETURN;
1806-
#endif
1807-
}
1808-
18091766
#endif /*EMBEDDED_LIBRARY*/
18101767

18111768

0 commit comments

Comments
 (0)