#1 2017-06-23 23:23:07

alpinistbg
Member
Registered: 2014-11-12
Posts: 124

Number of threads constantly incrementing

Hi ab,

the mORMot server application that I'm currently developing stops responding after a few days. The actual observation is that the number of threads incremented to >1800 and then, it fails in the TSynThread.Create(). Actually the number of threads never decrements. I'm creating the server in the following way:

Server := TSQLHttpServer.Create(PublishPort, [Database], '+', useHttpSocket);

The effect is not observed when:

Server := TSQLHttpServer.Create(PublishPort, [Database], '+', useHttpApi);

The OS is Win10, Lazarus v1.7 2017-6-17, FPC 3.1.1 SVN Revision 52654, SynopseCommit.inc '1.18.3447'.
Lazarus+mORMot installed with fpcupdeluxe.

EDIT: Same with SynopseCommit.inc '1.18.3680'

Any idea what might be the cause?

Regards,

Last edited by alpinistbg (2017-06-24 00:02:49)

Offline

#2 2017-06-24 05:16:03

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Number of threads constantly incrementing

Have you seen this ?
https://synopse.info/forum/viewtopic.php?id=3905
https://synopse.info/fossil/info/d0c1512d051ef958

So, would you mind trying a mORMot >= 1.18.3690
Dunno if this will help, buts its worth a try.

Offline

#3 2017-06-24 08:44:38

alpinistbg
Member
Registered: 2014-11-12
Posts: 124

Re: Number of threads constantly incrementing

Yes, commenting out 'Terminate; WaitFor;' worked out... Obviously the thread finishes without being terminated. What a surprise!

And for what was that unfortunate fix of TSynThread.Destroy?

Edit: Found this: https://synopse.info/forum/viewtopic.ph … 188#p19188
It seems that the clean up procedure is not as good as it should be. IMHO forced suspend/resume/terminate of a thread is a bad practice. Furthermore, the TThread.Terminate is of no meaning other than to inform TThread.Execute to complete its work. Calling it have no effect when Execute isn't working.

Last edited by alpinistbg (2017-06-24 10:01:11)

Offline

Board footer

Powered by FluxBB