Timeout when running CQRLOG towards MySQL / MariaDB under Linux

5 posts / 0 new
Last post
sm0kbd
Timeout when running CQRLOG towards MySQL / MariaDB under Linux

The reason for the timeout is the MySQL server timing out on "wait_timeout". This is a parameter in the

/etc/mysql/my.cnf

under

[mysqld]
wait_timeout=28800

It is set to the above value in the normal case. That is why it times out after eight hours. To make it easier to debug the timeout it can be set to e.g. 300 which is five minutes. Note that this change affect all sessions on the MySQL / MariaDB server.

Of the 5 threads setup in src/dData.pas the four last ones time out for me:

MainCon : TSQLConnection;
BandMapCon : TSQLConnection;
RbnMonCon : TSQLConnection;
LogUploadCon : TSQLConnection;
dbDXC : TSQLConnection;

Only the first one MainCon is "kept alive" somehow and survive. In my case only that session is used continuously. At least the way I run CQRLOG, which is having it connected to WSJT-X all the time.

A proposal to solve the timeout be to open those connections every-time the are used and then close them. I have not checked the documentation to see if there are other solutions. It is stated that the "KeepAlive" function is not implemented in Free Pascal. It is only kept for compatibility with Delphi. But from what I have understood it is not necessary only to send a query / keep alive packet but to also open and close the session to reset the timeout counter in MySQL / MariaDB. This of course implies that this is exactly what is happening with MainCon.

I will look further into it.

do2hg
Thanks for separating this. -

Thanks for separating this. - Otherwise you simply loose track.
And this ought to be followed as a bug ...
Stefan.

--
Stefan
DB4ST (ex DO2HG) --- German Ham Radio Station
D-32584 Löhne ----- Locator JO42IE

K4VBB
Has there been any update to

Has there been any update to this? This issue still plagues me.

--K4VBB

oh1kh
Timeout when running CQRLOG towards MySQL / MariaDB under Linux

Hi!
Many thanks for studying the root reason for this!

In my Fedora 35 there is no /etc/mysql/my.cnf. From /etc/my.conf I found an empty file.
Then there is a file in ~/.config/cqrlog/database/my.cnf that is also empty.

No other my.cnf are found.
Maybe because of that I have very hard to produce this problem. On the other hand I do not run cqrlog over night, just when I am in shack.

As you say there is no Keep alive in FPC and many tests of sending a timed query seems not help.
Perhaps disconnect/reconnect could help, but that kind of keep alive procedure should be run within a CriticalSection to avoid possible query happen while connection is closed.

If you have find a way to reproduce this problem within small time period it may help the keep alive procedure testing.

On the other hand: how big value "wait_timeout" can handle ?
Simplest way would then to add a zero or two to the end of current value.

It will be very interesting to hear about your progress.

--
Saku
OH1KH

LB2EG
Timeout when running CQRLOG towards MySQL / MariaDB under Linux

Hi All,
I have run into the same problem with the timeout after changing from local database to running the log on server. It looks like mysql/mariadb has a default timeout on 28800 seconds = 8 hours. Looking at the setup on my local database on cqrlog, I found that when running local database cqrlog setup files passes on wait_timeout=31536000 to mariadb, (~.config/cqrlog/database/mysql.conf)

I am running Ubuntu Linux 21.10 with a more complex setup than only /etc/mysql/my.cnf. I am a user with very little (none) programming or database experience. I have not found any option in cqrlog to pass on user defined commands to the server. I guess then the only option is to add the wait_timeout parameter to a system wide config file to alter the default time out time, but I am a bit lost where to write this config line.

73 de LB2EG Richard