Skip to content

Instantly share code, notes, and snippets.

@yoku0825
Created June 17, 2020 02:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yoku0825/a3a9884db90068ce8f33b82f7cef1d33 to your computer and use it in GitHub Desktop.
シャットダウンがハングした時の Connection_handler_manager::wait_till_no_connection のバックトレース
(gdb) bt full
+bt full
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
No locals.
#1 0x00000000007b7705 in native_cond_wait (mutex=0x1de8450 <Connection_handler_manager::LOCK_connection_count>,
cond=0x1de8410 <Connection_handler_manager::COND_connection_count>) at /home/yoku0825/mysql-5.7.30/include/thr_cond.h:147
No locals.
#2 my_cond_wait (mp=0x1de8450 <Connection_handler_manager::LOCK_connection_count>,
cond=0x1de8410 <Connection_handler_manager::COND_connection_count>) at /home/yoku0825/mysql-5.7.30/include/thr_cond.h:202
No locals.
#3 inline_mysql_cond_wait (that=0x1de8410 <Connection_handler_manager::COND_connection_count>,
mutex=0x1de8450 <Connection_handler_manager::LOCK_connection_count>,
src_file=0x12d60f0 "/home/yoku0825/mysql-5.7.30/sql/conn_handler/connection_handler_manager.cc", src_line=210)
at /home/yoku0825/mysql-5.7.30/include/mysql/psi/mysql_thread.h:1191
locker = 0x0
state = {
m_flags = 31515280,
m_operation = PSI_COND_WAIT,
m_cond = 0x2b58d90,
m_mutex = 0x7f23cc7f7c50,
m_thread = 0x1e0e290 <Events::event_queue>,
m_timer_start = 45206160,
m_timer = 0x1e0e270 <Events::db_repository>,
m_wait = 0x7f23cc7f7c70
}
result = <optimized out>
#4 Connection_handler_manager::wait_till_no_connection ()
at /home/yoku0825/mysql-5.7.30/sql/conn_handler/connection_handler_manager.cc:210
No locals.
#5 0x0000000000787451 in close_connections () at /home/yoku0825/mysql-5.7.30/sql/mysqld.cc:1102
dump_thread_count = 0
dump_thread_kill_retries = <optimized out>
thd_manager = 0x22c5d40
set_kill_conn = {
<Do_THD_Impl> = {
_vptr.Do_THD_Impl = 0x1c61430 <vtable for Set_kill_conn+16>
},
members of Set_kill_conn:
m_dump_thread_count = 0,
m_kill_dump_threads_flag = false
}
call_close_conn = {
<Do_THD_Impl> = {
_vptr.Do_THD_Impl = 0x1c61470 <vtable for Call_close_conn+16>
},
members of Call_close_conn:
is_server_shutdown = true
}
#6 signal_hand (arg=arg@entry=0x0) at /home/yoku0825/mysql-5.7.30/sql/mysqld.cc:2173
sig = 15
set = {
__val = {[0] = 16389,
[1] = 0 <repeats 15 times>}
}
#7 0x0000000000ee9a81 in pfs_spawn_thread (arg=0x2314740) at /home/yoku0825/mysql-5.7.30/storage/perfschema/pfs.cc:2197
typed_arg = 0x2314740
user_arg = 0x0
pfs = <optimized out>
user_start_routine = 0x786fb0 <signal_hand(void*)>
klass = <optimized out>
#8 0x00007f23f129aea5 in start_thread (arg=0x7f23cc7f8700) at pthread_create.c:307
__res = <optimized out>
pd = 0x7f23cc7f8700
now = <optimized out>
unwind_buf = {
cancel_jmp_buf = {[0] = {
jmp_buf = {[0] = 139791731492608,
[1] = 8926277761646558562,
[2] = 0,
[3] = 270336,
[4] = 0,
[5] = 139791731492608,
[6] = -8816048426653745822,
[7] = -8815972158318346910},
mask_was_saved = 0
}},
priv = {
pad = {[0] = 0x0,
[1] = 0x0,
[2] = 0x0,
[3] = 0x0},
data = {
prev = 0x0,
cleanup = 0x0,
canceltype = 0
}
}
}
not_first_call = <optimized out>
pagesize_m1 = <optimized out>
sp = <optimized out>
freesize = <optimized out>
#9 0x00007f23ef67e8dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
No locals.
@yoku0825
Copy link
Author

(gdb) bt
+bt
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00000000007b7705 in native_cond_wait (mutex=0x1de8450 <Connection_handler_manager::LOCK_connection_count>,
    cond=0x1de8410 <Connection_handler_manager::COND_connection_count>) at /home/yoku0825/mysql-5.7.30/include/thr_cond.h:147
#2  my_cond_wait (mp=0x1de8450 <Connection_handler_manager::LOCK_connection_count>,
    cond=0x1de8410 <Connection_handler_manager::COND_connection_count>) at /home/yoku0825/mysql-5.7.30/include/thr_cond.h:202
#3  inline_mysql_cond_wait (that=0x1de8410 <Connection_handler_manager::COND_connection_count>,
    mutex=0x1de8450 <Connection_handler_manager::LOCK_connection_count>,
    src_file=0x12d60f0 "/home/yoku0825/mysql-5.7.30/sql/conn_handler/connection_handler_manager.cc", src_line=210)
    at /home/yoku0825/mysql-5.7.30/include/mysql/psi/mysql_thread.h:1191
#4  Connection_handler_manager::wait_till_no_connection ()
    at /home/yoku0825/mysql-5.7.30/sql/conn_handler/connection_handler_manager.cc:210
#5  0x0000000000787451 in close_connections () at /home/yoku0825/mysql-5.7.30/sql/mysqld.cc:1102
#6  signal_hand (arg=arg@entry=0x0) at /home/yoku0825/mysql-5.7.30/sql/mysqld.cc:2173
#7  0x0000000000ee9a81 in pfs_spawn_thread (arg=0x2314740) at /home/yoku0825/mysql-5.7.30/storage/perfschema/pfs.cc:2197
#8  0x00007f23f129aea5 in start_thread (arg=0x7f23cc7f8700) at pthread_create.c:307
#9  0x00007f23ef67e8dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) frame 4
+frame 4
#4  Connection_handler_manager::wait_till_no_connection ()
    at /home/yoku0825/mysql-5.7.30/sql/conn_handler/connection_handler_manager.cc:210
210         mysql_cond_wait(&COND_connection_count, &LOCK_connection_count);
(gdb) p connection_count
+p connection_count
$2 = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment