The reason for the timeout is the MySQL server timing out on "wait_timeout". This is a parameter in the
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.