[MDEV-18289] perfschema.bad_option_3 fails with timeout : innodb hangs on shutdown, waiting for thd_destructor_proxy Created: 2019-01-17  Updated: 2019-01-17  Resolved: 2019-01-17

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Tests
Affects Version/s: 10.4
Fix Version/s: 10.4.2, 10.2.22, 10.3.13

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None


 Description   

can be seen e.g in
http://buildbot.askmonty.org/buildbot/builders/kvm-fulltest/builds/16348/steps/mtr_nm/logs/stdio

"shutdown" thread waits for thd_destructor_thread

#4  0x00007ff8577e598d in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
#5  0x000055e84b65e776 in innobase_end () at /home/buildbot/buildbot/build/mariadb-10.4.2/storage/innobase/handler/ha_innodb.cc:4350
#6  0x000055e84b416004 in ha_finalize_handlerton (plugin=0x55e84df93a98) at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/handler.cc:462
#7  0x000055e84b231f84 in plugin_deinitialize (plugin=0x55e84df93a98, ref_check=ref_check@entry=true) at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/sql_plugin.cc:1240
#8  0x000055e84b236cae in reap_plugins () at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/sql_plugin.cc:1316
#9  0x000055e84b237d15 in plugin_shutdown () at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/sql_plugin.cc:1982
#10 0x000055e84b163f68 in clean_up (print_message=<optimized out>) at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/mysqld.cc:2140
#11 0x000055e84b166536 in clean_up (print_message=<optimized out>) at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/mysqld.cc:8223
#12 unireg_abort (exit_code=2) at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/mysqld.cc:2052
#13 0x000055e84b168d24 in init_server_components () at /home/buildbot/buildbot/build/mariadb-10.4.2/sql/mysqld.cc:5382

correspondng code

		if (!srv_read_only_mode) {
			pthread_join(thd_destructor_thread, NULL);
		}

thd_destructor_thread at the same time waits for a condition

Thread 8 (Thread 0x7ff8157fa700 (LWP 27940)):
#0  0x00007ff8577ea360 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x000055e84b65ea43 in inline_mysql_cond_wait (src_file=0x55e84bb376e0 "/home/buildbot/buildbot/build/mariadb-10.4.2/storage/innobase/handler/ha_innodb.cc", src_line=303, mutex=0x7ff8157f9cf0, that=0x7ff8157f9d20) at /home/buildbot/buildbot/build/mariadb-10.4.2/include/mysql/psi/mysql_thread.h:1178
#2  thd_destructor_proxy () at /home/buildbot/buildbot/build/mariadb-10.4.2/storage/innobase/handler/ha_innodb.cc:303
#3  0x00007ff8577e46ba in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#4  0x00007ff856e8f82d in clone () from /lib/x86_64-linux-gnu/libc.so.6

corresponding code

	/* wait until the server wakes the THD to abort and die */
	while (!myvar->abort)
		mysql_cond_wait(&thd_destructor_cond, &thd_destructor_mutex);


Generated at Thu Feb 08 08:42:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.