No correctly shutdown when pool-of-threads is configured

i,
I set “thread_handling=pool-of-threads” to “my.cnf” on Precona-server 5.7.16-10-log.

Mysqld_safe detected that mysqld is downed, and Mysqld_safe restarted mysqld,
when mysql is shutdown with commands below:

Case1# /etc/init.d/mysql stop
Case2# kill “mysqld process id”

Log below was written.

2016-12-13T05:05:45.910205Z mysqld_safe Number of processes running now: 0
2016-12-13T05:05:45.911295Z mysqld_safe mysqld restarted

Shutdown process is not written.

I use “kill -9 all mysql process(mysqld_safe and mysqld)” in order to stop mysql.

if “thread_handling=one-thread-per-connection” is configured,
msyql is correctly shutdown with using above command.

Log below was written.

2016-12-14T11:44:52.475282+09:00 0 [Note] Giving 1 client threads a chance to die gracefully
2016-12-14T11:44:52.475325+09:00 0 [Note] Shutting down slave threads
2016-12-14T11:44:54.475460+09:00 0 [Note] Forcefully disconnecting 1 remaining clients
2016-12-14T11:44:54.475551+09:00 0 [Note] Event Scheduler: Killing the scheduler thread, thread id 1
2016-12-14T11:44:54.475566+09:00 0 [Note] Event Scheduler: Waiting for the scheduler thread to reply
2016-12-14T11:44:54.475711+09:00 0 [Note] Event Scheduler: Stopped
2016-12-14T11:44:54.475752+09:00 0 [Note] Event Scheduler: Purging the queue. 0 events
2016-12-14T11:44:54.475929+09:00 0 [Note] Binlog end
2016-12-14T11:44:54.477679+09:00 0 [Note] Shutting down plugin ‘validate_password’
2016-12-14T11:44:54.477710+09:00 0 [Note] Shutting down plugin ‘ngram’
2016-12-14T11:44:54.477715+09:00 0 [Note] Shutting down plugin ‘ARCHIVE’
2016-12-14T11:44:54.477743+09:00 0 [Note] Shutting down plugin ‘partition’
2016-12-14T11:44:54.477748+09:00 0 [Note] Shutting down plugin ‘BLACKHOLE’
2016-12-14T11:44:54.477753+09:00 0 [Note] Shutting down plugin ‘MEMORY’
2016-12-14T11:44:54.477763+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_VIRTUAL’
2016-12-14T11:44:54.477771+09:00 0 [Note] Shutting down plugin ‘INNODB_CHANGED_PAGES’
2016-12-14T11:44:54.477774+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_DATAFILES’
2016-12-14T11:44:54.477780+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESPACES’
2016-12-14T11:44:54.477796+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN_COLS’
2016-12-14T11:44:54.477809+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN’
2016-12-14T11:44:54.477821+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_FIELDS’
2016-12-14T11:44:54.477856+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_COLUMNS’
2016-12-14T11:44:54.477864+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_INDEXES’
2016-12-14T11:44:54.477867+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESTATS’
2016-12-14T11:44:54.477870+09:00 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLES’
2016-12-14T11:44:54.477873+09:00 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_TABLE’
2016-12-14T11:44:54.477876+09:00 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_CACHE’
2016-12-14T11:44:54.477878+09:00 0 [Note] Shutting down plugin ‘INNODB_FT_CONFIG’
2016-12-14T11:44:54.477895+09:00 0 [Note] Shutting down plugin ‘INNODB_FT_BEING_DELETED’
2016-12-14T11:44:54.477914+09:00 0 [Note] Shutting down plugin ‘INNODB_FT_DELETED’
2016-12-14T11:44:54.477921+09:00 0 [Note] Shutting down plugin ‘INNODB_FT_DEFAULT_STOPWORD’
2016-12-14T11:44:54.477924+09:00 0 [Note] Shutting down plugin ‘INNODB_METRICS’
2016-12-14T11:44:54.477927+09:00 0 [Note] Shutting down plugin ‘INNODB_TEMP_TABLE_INFO’
2016-12-14T11:44:54.477930+09:00 0 [Note] Shutting down plugin ‘INNODB_BUFFER_POOL_STATS’
2016-12-14T11:44:54.477933+09:00 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE_LRU’
2016-12-14T11:44:54.477939+09:00 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE’
2016-12-14T11:44:54.477953+09:00 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX_RESET’
2016-12-14T11:44:54.477967+09:00 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX’
2016-12-14T11:44:54.477970+09:00 0 [Note] Shutting down plugin ‘INNODB_CMPMEM_RESET’
2016-12-14T11:44:54.477973+09:00 0 [Note] Shutting down plugin ‘INNODB_CMPMEM’
2016-12-14T11:44:54.477975+09:00 0 [Note] Shutting down plugin ‘INNODB_CMP_RESET’
2016-12-14T11:44:54.477978+09:00 0 [Note] Shutting down plugin ‘INNODB_CMP’
2016-12-14T11:44:54.477984+09:00 0 [Note] Shutting down plugin ‘INNODB_LOCK_WAITS’
2016-12-14T11:44:54.477995+09:00 0 [Note] Shutting down plugin ‘INNODB_LOCKS’
2016-12-14T11:44:54.477998+09:00 0 [Note] Shutting down plugin ‘INNODB_TRX’
2016-12-14T11:44:54.478000+09:00 0 [Note] Shutting down plugin ‘XTRADB_RSEG’
2016-12-14T11:44:54.478003+09:00 0 [Note] Shutting down plugin ‘XTRADB_INTERNAL_HASH_TABLES’
2016-12-14T11:44:54.478005+09:00 0 [Note] Shutting down plugin ‘XTRADB_READ_VIEW’
2016-12-14T11:44:54.478008+09:00 0 [Note] Shutting down plugin ‘InnoDB’
2016-12-14T11:44:54.478072+09:00 0 [Note] InnoDB: FTS optimize thread exiting.
2016-12-14T11:44:54.478187+09:00 0 [Note] InnoDB: Starting shutdown…
2016-12-14T11:44:54.578444+09:00 0 [Note] InnoDB: Dumping buffer pool(s) to /mnt/ext0/mysql/ib_buffer_pool
2016-12-14T11:44:54.578770+09:00 0 [Note] InnoDB: Buffer pool(s) dump completed at 161214 11:44:54
2016-12-14T11:44:54.978770+09:00 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2016-12-14T11:44:56.392944+09:00 0 [Note] InnoDB: Shutdown completed; log sequence number 2491861
2016-12-14T11:44:56.394624+09:00 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2016-12-14T11:44:56.394649+09:00 0 [Note] Shutting down plugin ‘CSV’
2016-12-14T11:44:56.394659+09:00 0 [Note] Shutting down plugin ‘MyISAM’
2016-12-14T11:44:56.394677+09:00 0 [Note] Shutting down plugin ‘MRG_MYISAM’
2016-12-14T11:44:56.394687+09:00 0 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’
2016-12-14T11:44:56.394718+09:00 0 [Note] Shutting down plugin ‘sha256_password’
2016-12-14T11:44:56.394726+09:00 0 [Note] Shutting down plugin ‘mysql_native_password’
2016-12-14T11:44:56.394902+09:00 0 [Note] Shutting down plugin ‘binlog’
2016-12-14T11:44:56.397651+09:00 0 [Note] /usr/sbin/mysqld: Shutdown complete

I investigated.

When pool-of-threads is configured,
Mysql seems to not shutdown correctly with kill command.

I think that it’s necessary to shutdown mysql correctly with kill command when pool-of-threads is configured.

Please check this.

Thanks,
Mastaka

There is a bug already opened for this case - https://bugs.launchpad.net/bugs/1537554, please use the ‘affects me too’ link so you will be updated once the bug is fixed.

In the meantime the workaround is to replace killall -u mysql to mysqladmin shutdown in the init file /etc/init.d/mysql

Thank you for giving me this information.

I used the ‘affects me too’ link .

And I already have taken measure of your workaround.