You are not logged in.
Pages: 1
I have a mormot2 Delphi 11 vcl program with a TRestServerDB that connects to an external mysql database
The above TRestServerDB is available through a TRestHttpServer in the URL "http://127.0.0.1:44332/url/srv/" with WebSockets enabled
Everything works OK and I am using this server from the same program that has this server.
If I leave the computer and the program idle (no hibernation, sleep, or anything like that happens) the TRestHttpServer is not accessible the following day.
I make a thread timer to call a ServerTimestampSynchronize every 10 minutes and the following day, the server is accessible but the TRestServerDB does not work
A call to "http://127.0.0.1:44332/url/srv/Mytable/1" returns a 404 error in JSON
This seems to happen to an other computer too. I am not using any authentication or sessions and I have not an error in the meantime.
I have enabled verbose log to file to see if anything is reported in the logs, and I waiting for.
Do we expect something to automatically shutdown the service due to inactivity?
Offline
Hard to tell unless you provide a minimal example we can test, tbh I suspect it might be the new httpasync server which is the default in mORMot 2, can you test with the normal http socket server, or if you're using websockets, BidirSocket server.
TRestHttpServer.Create(..., TRestHttpServerUse.useHttpSocket,..l);
Offline
Hard to tell unless you provide a minimal example we can test, tbh I suspect it might be the new httpasync server which is the default in mORMot 2, can you test with the normal http socket server, or if you're using websockets, BidirSocket server.
TRestHttpServer.Create(..., TRestHttpServerUse.useHttpSocket,..l);
I compiled it with useBidirsocket and I will report tomorrow.
Offline
Enable the logs in verbose mode and I guess you may find something.
A minimal example would help.
Also ensure that https://github.com/synopse/mORMot2/comm … 80c7547bb2 did not fix it (sounds indeed like a dead lock).
Offline
I have left two clients, both with useBidirsocket, the first with the last patch and the other before
Both have the timer with the ServerTimestampSynchronize.
Both machines can work the following day and the problem seems to start from Zeos's connection timeout to mysql
I notice in mormot.qb.sql that there are two properties:
"ConnectionTimeOutMinutes": I should set that to less than mysql connection timeout
"ReconnectAfterConnectionError": It is by default false and I should probably enable it
Do you recommend something more before retesting it?
Last edited by dcoun (2022-02-24 09:21:57)
Offline
Please follow the forum rules and don't post such huge logs within the forum thread, but as external links.
It could help to have the raw log files, so that we could see it directly in our LogViewer.
Also enable Dwarf2 debug information to see the source line numbers of the exceptions.
Of course, properly setting ConnectionTimeOutMinutes may be needed.
If it is not enough, try also ReconnectAfterConnectionError.
Offline
I have deleted the logs and I apologize
It is not compiled in Lazarus so I will probably try it in debug mode today
Thank you a lot
Offline
With Delphi, just ensure the "detailed map info" is selected in the debugging project options.
At least, could you send a small reproducible example so that I could find what is wrong, add it to the regression tests?
Offline
I confirm that setting the ConnectionTimeOutMinutes to less minutes than the wait_timeout mysql variable (that it is in seconds) solves the problem.
I apologize for the trouble
Last edited by dcoun (2022-02-25 07:04:53)
Offline
Pages: 1