Killed connection threads might get their sockets closed twice on shutdown
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Invalid
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
Medium
|
Laurynas Biveinis | |||
5.7 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This shows up as a Valgrind warning
==18197== Warning: invalid file descriptor -1 in syscall close()
==18197== at 0x5F6E5BD: ??? (syscall-
==18197== by 0xF95F34: inline_
==18197== by 0xF96AF3: vio_shutdown (viosocket.c:490)
==18197== by 0x7C6BE0: THD::disconnect() (sql_class.cc:2057)
==18197== by 0x637486: close_connectio
==18197== by 0x7D63E3: do_handle_
==18197== by 0x7D5E57: handle_
==18197== by 0xB98416: pfs_spawn_thread (pfs.cc:1860)
==18197== by 0x5F656F9: start_thread (pthread_
==18197== by 0x6B22B5C: clone (clone.S:109)
on e.g.
rpl.rpl_
rpl.rpl_
rpl.rpl_report_port 'mix' w1 [ fail ] Found warnings/errors in server log file!
rpl.rpl_
rpl.rpl_
rpl.rpl_
rpl.rpl_
rpl.rpl_
rpl.rpl_
main.mysql_
auth_sec.
The reason is that THD::disconnect is getting called twice, once from server thread-killing thread:
kill_server_threads -> kill_server -> close_connections -> close_connection -> THD::disconnect;
and the second time from the query thread itself, as in the above stacktrace.
tags: | added: ci valgrind |
summary: |
- Killed connection threads might get their sockets closed twice + Killed connection threads might get their sockets closed twice on + shutdown |
https:/ /github. com/percona/ percona- server/ pull/500, https:/ /github. com/percona/ percona- server/ pull/501