Bug #87955 Unable to set connection timeout
Submitted: 3 Oct 2017 14:58 Modified: 17 Oct 2017 12:02
Reporter: Michal On Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.3.9 OS:Windows (Microsoft Windows 10 Pro)
Assigned to: CPU Architecture:Any
Tags: Connection, timeout

[3 Oct 2017 14:58] Michal On
Description:
It not possible to change default timeout (60 seconds) in connection properties. Because of this it is not possible to do longer model synchronization (e.g. adding index to table with many rows). As a workaround you can copy generated SQL into editor, which has own timeouts.

How to repeat:
Create / modify a connection, go to Advanced tab and change the timeout value. Close the window and open the connection again - timeout holds old value.
[4 Oct 2017 10:09] Chiranjeevi Battula
Hello Michal,

Thank you for the bug report.
Please change the Connection timeout here:
Edit -> Preferences -> Others -> Migration Connection Timeout.

Thanks,
Chiranjeevi.
[4 Oct 2017 10:09] Chiranjeevi Battula
Screenshots

Attachment: Bug_87955.JPG (image/jpeg, text), 71.70 KiB.

[4 Oct 2017 14:32] Michal On
Thank you, it helped - changing migration timeout automatically changes connection timeout. Maybe the issue should be "Connection timeout is set by migration timeout" which is a little confusing... :)
[4 Oct 2017 19:29] Michal On
Actually, this setting changes the timeout value in connection, but unfortunately the connection is lost during synchronization in about 20 seconds. The connection timeout is set to 3600 second. Is there any other timeout setting?
[5 Oct 2017 10:58] Chiranjeevi Battula
Hello Michal,

Thank you for the feedback.
This is most likely duplicate of Bug #63493, please see Bug #63493

Thanks,
Chiranjeevi.
[5 Oct 2017 12:17] Michal On
I don't think it's duplicate of 63493, because 63493 is related to SQL editor and workbench has a timeout setting for editor. This timeout doesn't have any influence on timeout during model synchronization. 
I measured the time to connection lost message and it's exactly 30 second. I tried to set every timeout I found on server or in workbench, but nothing helped.
I think this issue can be caused by some workbench/mysql update, because I use synchronization of model for a few years and sometimes it takes longer (several minutes), but I had never experienced such a problem with timeouts. I installed latest versions of workbench and mysql server just a few days ago after computer reinstall.
[5 Oct 2017 12:25] Michal On
One more information - I trying to add a column with foreign key. After the synchronization, which failed due the timeout, column is added, also index is added, but the foreign key reference is not.
[11 Oct 2017 12:30] Chiranjeevi Battula
Hello Michal,

Thank you for your feedback.
Could you please provide repeatable test case (exact steps, model, screenshot etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[11 Oct 2017 15:23] Michal On
The scenario is quite simple, you just need a long synchronization. In my case:
1. Create a model with two tables, don't add relation between these tables.
2. Synchronize model, so the database with tables will be created.
3. Generate a lot of data (millions of rows) and insert them into first table. 
4. Add a relation between these tables, the table with data must contain the foreign key, so the synchronization will take longer.
5. Do the synchronization, after 30 seconds it will fail with 
"Executing SQL script in server
ERROR: Error 2013: Lost connection to MySQL server during query"

If the synchronization is successful, check the duration, maybe is less than 30 second. If it's less, generate more data, or add more tables with same relation, so the table with data will contain more foreign keys and the synchronization will take longer.

I will upload a model with tables and a generate_data procedure. You just need to synchronize, run the procedure (maybe multiple times) and then add relation between "test" and other tables, so test table with contain the foreign key. And synchronize...
[11 Oct 2017 15:23] Michal On
test model

Attachment: test.mwb (application/octet-stream, text), 10.32 KiB.

[12 Oct 2017 12:46] Chiranjeevi Battula
Hello Michal,

Thank you for your feedback.
Can you please try modifying the "DBMS connection keep-alive interval (in seconds)" and the "DBMS connection read time-out (in seconds)" located in: Edit->Preferences->SQL Editor tab?

Thanks,
Chiranjeevi.
[12 Oct 2017 12:49] Chiranjeevi Battula
Screenshot

Attachment: 87955.PNG (image/png, text), 34.97 KiB.

[12 Oct 2017 13:33] Michal On
I have already tried to set these values without success, the connection was always lost after 30 seconds.
[12 Oct 2017 15:56] MySQL Verification Team
see https://bugs.mysql.com/bug.php?id=80188.
[16 Oct 2017 8:43] Michal On
I'm not sure, if it's related to bug 80188. I tried to set value of this timeout to high values (6000 seconds), but the connection is always lost after 30 seconds.
[17 Oct 2017 12:02] Chiranjeevi Battula
Hello Michal,

Thank you for your feedback.
I could not repeat this issue at my end with the provided information. 
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Thanks,
Chiranjeevi.