diff options
author | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2012-02-19 09:00:52 +0000 |
---|---|---|
committer | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2012-02-19 09:00:52 +0000 |
commit | 9965af5c6a13d3c0ab87529f8168b4b1b2473f0c (patch) | |
tree | 0025bc00c07e133e19f181fe8986af401208fcc5 /sql/mysqld.cc | |
parent | df2263533724a3dcefd7ce64f1afc87b83419faa (diff) | |
parent | 108445549bf0f9428ae714cfe41266f34adf12f8 (diff) | |
download | mariadb-git-9965af5c6a13d3c0ab87529f8168b4b1b2473f0c.tar.gz |
BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS
On shutdown(), Windows can drop traffic still queued for sending even if that
wasn't specifically requested. As a result, fatal errors (those after
signaling which the server will drop the connection) were sometimes only
seen as "connection lost" on the client side, because the server-side
shutdown() erraneously discarded the correct error message before sending
it.
If on Windows, we now use the Windows API to access the (non-broken) equivalent
of shutdown().
Backport from trunk
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 23992e8db41..f4b23e5b0c2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1045,7 +1045,7 @@ static void close_connections(void) { if (ip_sock != INVALID_SOCKET) { - (void) shutdown(ip_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(ip_sock, SHUT_RDWR); (void) closesocket(ip_sock); ip_sock= INVALID_SOCKET; } @@ -1077,7 +1077,7 @@ static void close_connections(void) #ifdef HAVE_SYS_UN_H if (unix_sock != INVALID_SOCKET) { - (void) shutdown(unix_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(unix_sock, SHUT_RDWR); (void) closesocket(unix_sock); (void) unlink(mysqld_unix_port); unix_sock= INVALID_SOCKET; @@ -1184,14 +1184,14 @@ static void close_server_sock() { ip_sock=INVALID_SOCKET; DBUG_PRINT("info",("calling shutdown on TCP/IP socket")); - (void) shutdown(tmp_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(tmp_sock, SHUT_RDWR); } tmp_sock=unix_sock; if (tmp_sock != INVALID_SOCKET) { unix_sock=INVALID_SOCKET; DBUG_PRINT("info",("calling shutdown on unix socket")); - (void) shutdown(tmp_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(tmp_sock, SHUT_RDWR); (void) unlink(mysqld_unix_port); } DBUG_VOID_RETURN; @@ -5191,7 +5191,7 @@ void handle_connections_sockets() if (req.sink) ((void (*)(int))req.sink)(req.fd); - (void) shutdown(new_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(new_sock, SHUT_RDWR); (void) closesocket(new_sock); continue; } @@ -5207,7 +5207,7 @@ void handle_connections_sockets() (SOCKET_SIZE_TYPE *)&dummyLen) < 0 ) { sql_perror("Error on new connection socket"); - (void) shutdown(new_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(new_sock, SHUT_RDWR); (void) closesocket(new_sock); continue; } @@ -5219,7 +5219,7 @@ void handle_connections_sockets() if (!(thd= new THD)) { - (void) shutdown(new_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(new_sock, SHUT_RDWR); (void) closesocket(new_sock); continue; } @@ -5238,7 +5238,7 @@ void handle_connections_sockets() vio_delete(vio_tmp); else { - (void) shutdown(new_sock, SHUT_RDWR); + (void) mysql_socket_shutdown(new_sock, SHUT_RDWR); (void) closesocket(new_sock); } delete thd; |