You are not logged in.
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
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
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
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
At HTTP client connection level, you have ResolveTimeout / ConnectTimeout / SendTimeout / ReceiveTimeout properties.
You can access those properties from TSQLHttpClientWinGeneric.WinAPI.
Offline
ReceiveTimeout doesn't work. I had to manually change the HTTP_DEFAULT_RECEIVETIMEOUT constant in source code.
Offline