#1 2023-06-11 14:00:41

blue
Member
Registered: 2023-05-05
Posts: 9

THttpAsyncConnections pending overflow with 2.0.stable

IDE: Delphi 2007.
OS: Windows server 2012.

An HTTP server based on THttpServerSocketGeneric, which will probably run for 3 days and then produce such logs:
mormot.net.async.THttpAsyncConnections(ddda490120) Execute: Accept connections=58>7777777 pending=10001>10000 overflow
...

Roll back to 2.0.4383, works fine.

Thanks a lot!

Offline

#2 2023-06-12 06:37:33

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

Re: THttpAsyncConnections pending overflow with 2.0.stable

Weird.
It sounds like if the processing threads are blocked, so there is no thread to accept the new connections.

What are the exceptions or errors logged, before it avoids to accept the connections?
What are the logs saying about the processing threads?
(please don't put logs in the forum directly, but a a gist/pastebin link)
The message you are sharing is only about not being able to create the connection class instances in the internal list.

Note that on Windows, with a few connections, you would rather use either http.sys (useHttpApi) or the plain socket (useHttpSocket) kind of servers than useHttpAsync.

Offline

#3 2023-06-17 17:55:51

Coldzer0
Member
Registered: 2018-08-31
Posts: 28

Re: THttpAsyncConnections pending overflow with 2.0.stable

I got the same error on logs after keeping the server running for a couple of hours.

I'll try to enable trace logging and see if I can get it to have the same issue again.


Mac, Windows, Linux
FPC Trunk, Lazarus Trunk, Delphi 12 Latest

Offline

#4 2023-06-18 06:46:31

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

Re: THttpAsyncConnections pending overflow with 2.0.stable

Once the logs are enabled, ensure the lock is not within your processing method themselves.
For instance, a race condition with mutexes could happen in your business code.
There should be a "Leave" for each of your SOA methods "Enter".

If the processing methods are blocked and never finishes, then the threads of the HTTP server would exhaust, and any incoming connections would be rejected.

Offline

#5 2023-06-26 07:16:00

blue
Member
Registered: 2023-05-05
Posts: 9

Re: THttpAsyncConnections pending overflow with 2.0.stable

After 10 days of testing, the bug was not reproduced. I suspect the problem was caused by the use of FastMM4.
Thank you all.

Offline

Board footer

Powered by FluxBB