Bug #111889 SSH Connection Persists
Submitted: 26 Jul 2023 4:57 Modified: 27 Jul 2023 22:16
Reporter: Daniel L Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.19 OS:Windows
Assigned to: CPU Architecture:Any

[26 Jul 2023 4:57] Daniel L
Description:
I am using MySQL Workbench to connect to a MySQL database hosted on a Linux server running Almalinux 8.8.0 and MySQL 8.0.

When I connect to the MySQL server using MySQL Workbench, several processes begin on the Linux Server, such as sshd, systemd and sd-pam. These processes typically terminate after a SSH session ends, however, I have noticed that they persist after I close the connection tab in MySQL Workbench.

It seems that the SSH tunnel remains open even after the Connection tab is closed in MySQL Workbench.

The only way to properly terminate the connection is by closing MySQL Workbench entirely. When I close MySQL Workbench, I can see that the session processes, sshd, systemd and sd-pam, terminate immediately after.

I have also confirmed this with Wireshark. I can see the SSH tunnel only terminates when I exit MySQL Workbench entirely, rather than when I exit the connection tab.

Further, if I close and re-open Connections to the same server in MySQL Workbench, a new SSH session is generated each time. This means that if I open and close a Connection twice, MySQL Workbench will keep two SSH sessions alive, using only the second session to execute queries.

How to repeat:
Monitor TCP Packets
Monitor Server ps aux
Open MySQL Workbench
Create a Standard TCP/IP Over SSH Connection
Open the connection
Close the connection tab - Notice SSH tunnel persists
Close MySQL Workbench - Notice that SSH tunnel is terminated

Suggested fix:
Terminate the SSH tunnel when the connection tab is closed
[27 Jul 2023 11:47] MySQL Verification Team
Hello Daniel,

Thank you for the bug report.
Imho this is duplicate of Bug #99911, please see Bug #99911.

Regards,
Ashwini Patil
[27 Jul 2023 22:16] Daniel L
Hey Ashwini, thank you for your response.

I am not aware of how MySQL Workbench is built, if the same code is used to facilitate the "Test Connection" and the Opening / Closing of a connections tab, I agree they may be the same bug.

However, if the two features do not depend on the same code, fixing one bug may not necessarily fix the other.
[28 Jul 2023 11:35] MySQL Verification Team
Hello Daniel,

Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.