Commit 679b8dc1 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-3839 : on Solaris 10, KILLing slave thread has no effect.

The reason for the error is missing definition for SIGNAL_WITH_IO_CLOSE on this platform
which now needs to  always be defined, as in 5.6

On Solaris10 only, this preprocessor constant was not defined,  thus code that shutdowns a socket in THD::awake was not executed, and polling thread was not interrupted.

Fix is to always define SIGNAL_WITH_IO_CLOSE, just like MySQL5.6 does.
parent 73c8e441
......@@ -936,49 +936,13 @@ CHECK_CXX_SOURCE_COMPILES("
"
HAVE_SOLARIS_STYLE_GETHOST)
# Use of ALARMs to wakeup on timeout on sockets
#
# This feature makes use of a mutex and is a scalability hog we
# try to avoid using. However we need support for SO_SNDTIMEO and
# SO_RCVTIMEO socket options for this to work. So we will check
# if this feature is supported by a simple TRY_RUN macro. However
# on some OS's there is support for setting those variables but
# they are silently ignored. For those OS's we will not attempt
# to use SO_SNDTIMEO and SO_RCVTIMEO even if it is said to work.
# See Bug#29093 for the problem with SO_SND/RCVTIMEO on HP/UX.
# To use alarm is simple, simply avoid setting anything.
SET(NO_ALARM 1 CACHE BOOL "No need to use alarm to implement timeout")
IF(WIN32)
SET(HAVE_SOCKET_TIMEOUT 1)
ELSEIF(CMAKE_SYSTEM MATCHES "HP-UX")
SET(HAVE_SOCKET_TIMEOUT 0)
ELSEIF(CMAKE_CROSSCOMPILING)
SET(HAVE_SOCKET_TIMEOUT 0)
ELSE()
SET(CMAKE_REQUIRED_LIBRARIES ${LIBNSL} ${LIBSOCKET})
CHECK_C_SOURCE_RUNS(
"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
int main()
{
int fd = socket(AF_INET, SOCK_STREAM, 0);
struct timeval tv;
int ret= 0;
tv.tv_sec= 2;
tv.tv_usec= 0;
ret|= setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
ret|= setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
return !!ret;
}
" HAVE_SOCKET_TIMEOUT)
ENDIF()
# As a consequence of ALARMs no longer being used, thread
# notification for KILL must close the socket to wake up
# other threads.
SET(SIGNAL_WITH_VIO_CLOSE 1)
SET(NO_ALARM "${HAVE_SOCKET_TIMEOUT}" CACHE BOOL
"No need to use alarm to implement socket timeout")
SET(SIGNAL_WITH_VIO_CLOSE "${HAVE_SOCKET_TIMEOUT}")
MARK_AS_ADVANCED(NO_ALARM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment