#1 2013-06-03 13:48:08

ah
Member
Registered: 2013-05-17
Posts: 9

995 error in server - can mormot split packages?

Hi, I'm using an interface-based method to execute a server-side SQL and return results. My function is as simple as this:

    function Execute(const aSQL: RawUTF8; aExpectResults: boolean; const Params: RawJSON): RawJSON;

This function executes the SQL and returns the full dataset in the RawJSON result parametes. Problem is from time to time I'm having the following error:

EXC   EHttpApiServer ("HttpSendHttpResponse failed: The I/O operation has been aborted because of either a thread exit or an application request (995)")

Do you have an idea why this error occurs?
It seems to me that it happens when my dataset result is very big. I'm sure the SQL is executing fast, but maybe mormot is taking too much time in building the rawjson or maybe the data is just too big for the http to handle it?
Can it maybe that mormot sends the result is separated packages, maybe chunked response, etc. (I know DataSnap can do that).

So, unless you have another idea, my guess is this error is happening because the RawJSON result is too big, then my question is: is there a easy way for mormot to handle such big results?

Thanks in advance.

Offline

#2 2013-06-03 15:09:06

eraldo
Member
From: Brasil
Registered: 2010-07-22
Posts: 69
Website

Re: 995 error in server - can mormot split packages?

Hi,

How many lines are expected in the result?

Offline

#3 2013-06-03 15:28:29

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

Re: 995 error in server - can mormot split packages?

The http.sys kernel-mode HTTP server does not implement chunking by itself.

You can enable logging and find out what takes time in the request.

Sounds to me like if the error comes from the client side.
The error may come from the fact that socket is already closed.

Which component are you using on the client?
Please make the timeout value higher on client side.
Since there is no chunking, the client may time out before it receives the whole content.

Offline

#4 2013-06-03 15:38:59

eraldo
Member
From: Brasil
Registered: 2010-07-22
Posts: 69
Website

Re: 995 error in server - can mormot split packages?

Until now I get 10 000 lines almost instantly.

Offline

#5 2013-06-03 21:27:25

ah
Member
Registered: 2013-05-17
Posts: 9

Re: 995 error in server - can mormot split packages?

ab wrote:

The http.sys kernel-mode HTTP server does not implement chunking by itself.

You can enable logging and find out what takes time in the request.

Sounds to me like if the error comes from the client side.
The error may come from the fact that socket is already closed.

Which component are you using on the client?
Please make the timeout value higher on client side.
Since there is no chunking, the client may time out before it receives the whole content.

1. On the client I'm just using the interface to access the server methods.
2. In the http.sys kernel-mode can't you keep sending parts of the body? I believe you can make multiple HttpSendHttpResponseBody calls can't you?
3. How can I increase timeout in client?
4. Logging is already enabled, that's the message I get from log.

Offline

#6 2013-06-04 08:07:27

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

Re: 995 error in server - can mormot split packages?

Check the time elapsed on the server in each method.

Search the doc first for timeout. Use latest 1.18 version.

Offline

#7 2013-06-04 14:19:24

ah
Member
Registered: 2013-05-17
Posts: 9

Re: 995 error in server - can mormot split packages?

ab wrote:

Check the time elapsed on the server in each method.

Search the doc first for timeout. Use latest 1.18 version.

I could not find anything related to timeout in TSQLHttpClient which I'm using. Are you referring to KeepAliveMS property?
I'm using latest 1.18.

Offline

#8 2013-06-04 14:53:55

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,544
Website

Re: 995 error in server - can mormot split packages?

If you use one of sicClientDriven, sicPerSession, sicPerUser or sicPerGroup modes - look on TServiceFactoryServer property TimeoutSec

Offline

#9 2013-06-04 15:15:12

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

Re: 995 error in server - can mormot split packages?

At HTTP client connection level, you have ResolveTimeout / ConnectTimeout / SendTimeout / ReceiveTimeout properties.

You can access those properties from TSQLHttpClientWinGeneric.WinAPI.

Offline

#10 2013-06-06 13:39:37

ah
Member
Registered: 2013-05-17
Posts: 9

Re: 995 error in server - can mormot split packages?

ReceiveTimeout doesn't work. I had to manually change the HTTP_DEFAULT_RECEIVETIMEOUT constant in source code.

Offline

#11 2013-06-06 18:04:11

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

Re: 995 error in server - can mormot split packages?

... and it worked?

Offline

Board footer

Powered by FluxBB