mariadb/include
Thayumanavar 5345586680 BUG#14458232 - CRASH IN THD_IS_TRANSACTION_ACTIVE DURING
THREAD POOLING STRESS TEST
PROBLEM:
Connection stress tests which consists of concurrent
kill connections interleaved with mysql ping queries
cause the mysqld server which uses thread pool scheduler
to crash.
FIX:
Killing a connection involves shutdown and close of client
socket and this can cause EPOLLHUP(or EPOLLERR) events to be
to be queued and handled after disarming and cleanup of 
of the connection object (THD) is being done.We disarm the 
the connection by modifying the epoll mask to zero which
ensure no events come and release the ownership of waiting 
thread that collect events and then do the cleanup of THD.
object.As per the linux kernel epoll source code (               
http://lxr.linux.no/linux+*/fs/eventpoll.c#L1771), EPOLLHUP
(or EPOLLERR) can't be masked even if we set EPOLL mask
to zero. So we disarm the connection and thus prevent 
execution of any query processing handler/queueing to 
client ctx. queue by removing the client fd from the epoll        
set via EPOLL_CTL_DEL. Also there is a race condition which
involve the following threads:
1) Thread X executing KILL CONNECTION Y and is in THD::awake
and using mysys_var (holding LOCK_thd_data).
2) Thread Y in tp_process_event executing and is being killed.
3) Thread Z receives KILL flag internally and possible call
the tp_thd_cleanup function which set thread session variable
and changing mysys_var.
The fix for the above race is to set thread session variable
under LOCK_thd_data.
We also do not call THD::awake if we found the thread in the
thread list that is to be killed but it's KILL_CONNECTION flag
set thus avoiding any possible concurrent cleanup. This patch
is approved by Mikael Ronstrom via email review.
2012-11-09 14:54:35 +05:30
..
atomic Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mysql BUG#14458232 - CRASH IN THD_IS_TRANSACTION_ACTIVE DURING 2012-11-09 14:54:35 +05:30
base64.h
CMakeLists.txt Updated/added copyright headers 2011-06-30 17:46:53 +02:00
decimal.h Updated/added copyright headers 2012-02-15 17:21:38 +01:00
errmsg.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
ft_global.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
hash.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
heap.h Updated/added copyright headers 2012-02-15 17:13:47 +01:00
keycache.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
lf.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
m_ctype.h Updated/added copyright headers 2012-02-16 10:48:16 +01:00
m_string.h Upmerge the AIX compile fix into 5.5. 2012-02-16 16:03:43 +01:00
my_aes.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_alarm.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_alloc.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_atomic.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_attribute.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_base.h Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DML 2012-03-01 11:05:51 +05:30
my_bit.h Updated/added copyright headers 2011-07-04 01:25:49 +02:00
my_bitmap.h Updated/added copyright headers 2011-07-04 01:25:49 +02:00
my_compare.h Bug#11933945 REMOVE LGPL LICENSED FILES IN MYSQL 5.5 2011-03-29 14:43:49 +02:00
my_compiler.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_dbug.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_dir.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_getopt.h Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING) 2012-06-29 13:36:01 +02:00
my_global.h Updated/added copyright headers 2012-02-16 10:48:16 +01:00
my_libwrap.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_list.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_md5.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_net.h Bug#11933945 REMOVE LGPL LICENSED FILES IN MYSQL 5.5 2011-03-29 14:43:49 +02:00
my_nosys.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_pthread.h Bug#11765237 - 58179: CANNOT START MYSQLD WITH APP VERIFIER 2011-03-01 13:03:31 +01:00
my_rdtsc.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_stacktrace.h Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS 2011-12-02 14:16:48 +01:00
my_sys.h Updated/added copyright headers 2011-06-30 17:31:31 +02:00
my_time.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_tree.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_uctype.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_user.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_xml.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
myisam.h Updated/added copyright headers 2012-02-16 10:48:16 +01:00
myisammrg.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
myisampack.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mysql.h Bug #12998841: libmysql divulges plaintext password upon request in 5.5 2012-07-05 09:55:20 +03:00
mysql.h.pp Bug #12998841: libmysql divulges plaintext password upon request in 5.5 2012-07-05 09:55:20 +03:00
mysql_com.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mysql_embed.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mysql_time.h
mysql_version.h.in Bug #15327: configure: --with-tcp-port option being partially ignored 2007-09-13 16:19:46 +02:00
mysys_err.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
password.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
probes_mysql.d.base Updated/added copyright headers 2011-06-30 17:46:53 +02:00
probes_mysql.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
probes_mysql_nodtrace.h merge mysql-5.1->mysql-5.5 2011-07-07 12:42:14 +03:00
queues.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
rijndael.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
service_versions.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
sha1.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
sha2.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
sql_common.h Bug #12998841: libmysql divulges plaintext password upon request in 5.5 2012-07-05 09:55:20 +03:00
sslopt-case.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
sslopt-longopts.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
sslopt-vars.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
t_ctype.h
thr_alarm.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
thr_lock.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
typelib.h Fix for BUG#59894 2011-02-11 15:00:09 +01:00
violite.h Merge 5.5.24 back into main 5.5. 2012-05-07 22:20:42 +02:00
welcome_copyright_notice.h Bug#13928675 MYSQL CLIENT COPYRIGHT NOTICE MUST 2012-08-07 18:58:19 +05:30