Bug #79575 MySQL Keep alive using SSH tunnel not working correctly.
Submitted: 9 Dec 2015 13:35 Modified: 1 Feb 2016 21:53
Reporter: Ronald Hummelink Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.3.5 OS:Windows (Microsoft Windows 10 Enterprise)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[9 Dec 2015 13:35] Ronald Hummelink
Description:
Despite keep alive settings on both the SSH and MySQL connections, after a period of idle, the MySQL connection dies.

DBMS keep-alive is set to 60 seconds. SSH keep-alive to 120s.

It appears DBMS keep-alive is not used for tunneled connections?

09:40:05 [INF][     SSH tunnel]: Opening SSH tunnel to <edited out>
09:40:06 [INF][     SSH tunnel]: TunnelManager.wait_connection returned OK
09:40:06 [INF][     SSH tunnel]: SSH tunnel connect executed OK
09:40:07 [INF][      SqlEditor]: Opened connection '<edited out>' to Source distribution version 5.1.73-log
09:40:08 [INF][     AutoCCache]: Initializing autocompletion cache for <edited out>
09:40:09 [INF][        WQE.net]: Launching SQL IDE
09:40:10 [INF][        WQE.net]: SQL IDE UI is ready
13:24:58 [WRN][SqlEditorSchemaTree]: Error fetching column information for '<edited out>'.'<edited out>': MySQL server has gone awayError fetching index information for '<edited out>'.'<edited out>': MySQL server has gone away

How to repeat:
Open connection, use, leave over lunch.

Suggested fix:
Enable DBMS keep-alive for tunneled connections.
[10 Dec 2015 15:07] MySQL Verification Team
Thank you for the bug report. Please provide step by step how you did the setup of the offended connection. I couldn't repeat on Windows 10 Pro forwarding the port 3306 to a CentOS 6.7 Linux running 6.7.10. Thanks in advance.
[10 Dec 2015 15:38] Ronald Hummelink
Thanks for looking into this. 

I have attached my.cnf from the server (With comments/empty lines stripped)
and Workbench connections.xml (Redacted as we rather not make user/hostnames public)

The connection is to a MySQL 5.1.73 server running on a Red Hat Enterprise 6.7 host, with OpenSSH 5.3p1. MySQL password saved in vault, SSH key details taken from Pageant.
[16 Dec 2015 9:39] MySQL Verification Team
Thank you for the feedback. Please try version 6.3.6. Thanks.
[21 Dec 2015 12:01] Ronald Hummelink
Unfortunately I'm not noticing any improvement :(

It is not even doing an automatic reconnect - which works when selected from menus.
[7 Jan 2016 8:37] László Somogyi
That DBMS keep-alive doesn't work for anything since 6.3.5, not just SSH. When i tried 6.3.5 then the SSH keepalive worked for me, just workbench crashed for everything else. With tcp you have no chance.

The last working workbench is 6.3.4, there the dbms keepalive option works for tcp and ssh too...
[7 Jan 2016 8:59] László Somogyi
I mean in 6.3.4 the dbms keep alive option keeps alive the SSH connection too, but from 6.3.5 it doesn't work. Only the new SSH keep-alive works, but ofc only for the SSH con, and the db goes away when it times out (and yes need to click manually on the rdms reconnect button).

Similar for tcp. In 6.3.4 the tcp connection is kept alive by the dbms option, but since 6.3.5 it doesn't work. So this way not only the db goes away, but need a full reconnect each time = no keep-alive for tcp.
[1 Feb 2016 21:53] MySQL Verification Team
Duplicate/related to http://bugs.mysql.com/bug.php?id=80225.