Bug #79504 STOP SLAVE IO THREAD prints wrong LOST CONNECTION message in error log file.
Submitted: 3 Dec 2015 10:00 Modified: 29 Mar 2016 20:59
Reporter: Venkatesh Duggirala Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: CPU Architecture:Any

[3 Dec 2015 10:00] Venkatesh Duggirala
Description:
STOP SLAVE IO_THREAD closes socket communication between Master and Slave. 
This prints an ERROR message in the error log 

[ERROR] Error reading packet from server: Lost connection to
MySQL server during query (server_errno=2013)

Here the socket closed intentionally by the DBA using command 'STOP SLAVE IO_THREAD'
Hence no need to print the message [ERROR] that says "Lost connection" which will
panic the DBAs.

There are two bugs in the past bug 11761457 and bug 12977988 raised for the same reason. It is marked as fixed and pushed in 5.7.0 but it is not fixing the real issue.

How to repeat:
--source include/master_slave.inc

--connection slave
STOP SLAVE IO_THREAD

# Observe error log file , [ERROR] Lost connection will be there.

Suggested fix:

Do not print the panic message if connection(IO thread) is closed by DBA intentionally.
[29 Mar 2016 20:59] Daniel So
Added the following entry to the server 5.6.30, 5.7.12, and 5.8.0 changelogs:

"Issuing STOP SLAVE caused a spurious Error reading packet from server: Lost connection to MySQL server during query message to be written to the error log. With this fix, when connection to the master is lost, the abort_slave flag is checked and the error message is printed only if the flag is not set."