[Feature request] Add plink disconnect timeout to SSH tunnel tab

[expired user #8837]'s profile image [expired user #8837] posted 9 years ago in Feature discussion Permalink
Hi!
I use HeidiSQL to manage MySQL DB through SSH tunnel.
But 20 seconds after last query to DB plink.exe process is closing, so when i just want to open another table in same DB HeidiSQL need to:
1) create new plink.exe process
2) connect throught plink.exe to DB
3) run set of queries such as

SHOW STATUS;
SHOW VARIABLES;
USE `dbname`;
SHOW CREATE TABLE `dbname`.`tablename`;
SHOW COLLATION;
SHOW ENGINES;
SHOW CREATE TABLE `dbname`.`tablename`;

All this takes much time. So i could increase plink timeout, so HeidiSQL will close plink.exe process after few minues up to few hours instead of 20 seconds.

Is this timeout hardcoded to dbconnection.pas (FKeepAliveTimer.Interval := 20000;)???

I tried to change this value and re-compile it with Delphi 2010, but i can't find good guide how to compile HeidiSQL and where to get components and other requiments you are using in HeidiSQL. Is there some good build guide?

P.S.: HeidiSQL is my favourite software for database management, but this little issue is very annoying.
ansgar's profile image ansgar posted 9 years ago Permalink
Weird thing. There is only the wait timeout, which is configurable in the session manager's "SSH tunnel" tab. But that's just the time which is granted for plink until HeidiSQL assumes plink hasn't got established a connection. When you see SHOW STATUS and other queries, this time has already finished.

The FKeepAliveTimer interval is hardcoded, yes. But it should not close your connection or the plink process.

Btw, does HeidiSQL then crash or what's exactly happening?

Could you try to run the plink.exe command line separately from HeidiSQL and see if that changes something?
[expired user #8837]'s profile image [expired user #8837] posted 9 years ago Permalink
HeidiSQL does not crash after this.

I configured port forwarding with plink this way
plink.exe -v -ssh username@111.111.111.111 -pw "password" -N -L 3307:127.0.0.1:3306


Then configured new conection in HeidiSQL
Hostname/IP: 127.0.0.1
User: username
Password: password
Port: 3307


HeidiSQL connects to MySQL successfully, but after 20 seconds (i measuredsmile) i have this in logs:
/* Connection to 127.0.0.1 closed at 2015-04-11 12:12:19 */


And when i click another table name to manage it i've got this
/* Connecting to 127.0.0.1 via MySQL (TCP/IP), username username, using password: Yes ... */
/* Connected. Thread-ID: 883329349 */
/* Unknown character set: 'utf8mb4' */
/* Characterset: utf8 */
SHOW STATUS;
SHOW VARIABLES;
USE `dbname`;
SHOW CREATE TABLE `dbname`.`tablename`;
SHOW COLLATION;
SHOW ENGINES;
SHOW CREATE TABLE `dbname`.`tablename`;
ansgar's profile image ansgar posted 9 years ago Permalink
And then after 20 seconds the same disconnect happens I guess.

If so, this must be due to the automatic keep-alives. Strange.

However, I could make the keep-alives optional. I guess that should be a session setting, not a global setting. And it could be a checkbox, in the "Advanced" tab.

Alternatives?
[expired user #8837]'s profile image [expired user #8837] posted 9 years ago Permalink
What if keep-alives would be configurable, so user can set keep-alive time in seconds.
If user set keep-alive equal to 0, this means keep-alive is off.

I think this is good idea to put that session setting to "Advanced" tab.
ansgar's profile image ansgar posted 8 years ago Permalink

r5052 does exactly that - adds a new session setting for the keep-alive-intervals into the "Advanced" tab.

See also http://www.heidisql.com/forum.php?t=20829

[expired user #8837]'s profile image [expired user #8837] posted 8 years ago Permalink

Thank you very much! Now my connection does not close and restart like before. Now everything work just fine! Thanks for a great support! HeidiSQL is one of my favourite software.

Please login to leave a reply, or register at first.