#1 2022-02-23 11:43:52

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Mormot2 orm unavailable

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

#2 2022-02-23 12:20:10

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 209

Re: Mormot2 orm unavailable

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

#3 2022-02-23 12:48:36

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Mormot2 orm unavailable

pvn0 wrote:

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

#4 2022-02-23 14:58:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Mormot2 orm unavailable

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

#5 2022-02-24 09:00:24

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Mormot2 orm unavailable

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

#6 2022-02-24 09:11:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Mormot2 orm unavailable

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

#7 2022-02-24 09:26:46

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Mormot2 orm unavailable

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

#8 2022-02-24 09:38:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Mormot2 orm unavailable

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

#9 2022-02-25 07:03:40

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Mormot2 orm unavailable

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

Board footer

Powered by FluxBB