106
Views
19
Comments
Server Request Timeout - Reactive Web
Question

Reactive Web Application.

I would like to ask for your advice, I'm using reactive web also. Calling a server action from a Client action, there is a default Server Request Timeout set. When that certain server timeout  was hit, will it leave the called server action running even server timeout is already invoke in client side? Currently my observation is even timeout was raised in client side, the server action will still run and finish.

Rank: #56

Hi Cie,


It means that it will throw an exception of timeout (something like this Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ).


The server action will be aborted and you can handle the exception the way you want.

If you want things to be run on the server without the client side having to wait, you can trigger a timer or launch a BPT / Light BPT to process the server side action asynchronously.


Hope it helps.


Cheers,

João Marques

Rank: #21451

Hi Joao,

Actually, the server action that was triggered did not stop at all. It finished the execution on the server side. So im not sure if this is how Reactive web current behavior..Im expecting that the invoked Server Action will be aborted but it did not.

Rank: #257

You are right, Cie, that's exactly what I noticed as well. The front-end times out, but the server request gets executed till the end.

Rank: #21451

Tim Timperman wrote:

You are right, Cie, that's exactly what I noticed as well. The front-end times out, but the server request gets executed till the end.

 Yeah, so im looking for a way to handle such scenario..but i cannot find so i tried asking here if maybe someone done it before..

 

Rank: #56

Hi Cie,


You are right, my bad.

I was reading the documentation and the Server Request Timeout is the time the client will wait before throwing a communication exception, thus not aborting the server action when the limit time is reached.


What you can do to force the server side to have a given timeout is pass a parameter for seconds and on the server side action you use the SetRequestTimeout action from HTTPRequestHandler API (see here). In this way, you can control from the client, the timeout the server will have and you can force it to be the same.


Cheers,

João

Rank: #21451

Hi Joao, that is what im thinking right now..Ill try then ill let you know..Thanks.

Rank: #56

I'm curious to see how it goes, it would still be a workaround but it sounds good. João

Rank: #21451

Hi Joao, it didn't work hehehe..

Rank: #56

Hi Cie,


It does sound like a bug, since according to the documentation the action sets the timeout of the current HTTP request and a server action is an HTTPS request. At least it does not match the documentation.

Rank: #21451

Yeah, im not sure what should be the handling for this scenario...

Rank: #21451

Does anyone knows how to handle this Server Timeout issue in Client side?

Rank: #21451

I still wasn't able to resolve the issue..hmmm anyone know how to handle such?

mvp_badge
MVP
Rank: #50

Hi Cie,

I had the same issue in past which i manage initially by increasing the Server Request Timeout at module level . The default Timeout was 10Sec which you can change to any other time.

Then i realize that the server action that i build has a lot of functionality and multiple server actions inside it and is taking more then 10 seconds to execute . I then looked into all such server action and break them in two or more server actions which solved the timeout issue and then i changed the Server Request Timeout value back to 10 Seconds.

You can also see such warnings in Architecture Dashboard about long Server Actions.



Regards,

-PJ-

Rank: #21451

Pramod Jain wrote:

Hi Cie,

I had the same issue in past which i manage initially by increasing the Server Request Timeout at module level . The default Timeout was 10Sec which you can change to any other time.

Then i realize that the server action that i build has a lot of functionality and multiple server actions inside it and is taking more then 10 seconds to execute . I then looked into all such server action and break them in two or more server actions which solved the timeout issue and then i changed the Server Request Timeout value back to 10 Seconds.

You can also see such warnings in Architecture Dashboard about long Server Actions.



Regards,

-PJ-

 Hi PJ,

Actually im not looking into avoiding the Server timeout,  im just looking for a way that one server timeout is raised in Client side, any server action invoked should also aborted.. thanks.

 

mvp_badge
MVP
Rank: #50

Hi Cie,

I got your point , but here actually the server action is not timing out rather the client request which is supposed to wait for 10 Sec (default timeout) is timing out and the server action will continue until it reaches to the end of execution or it reaches to its own timeout.

The default Server request timeout is AFAIK is 100 sec and hence the chances of having server request timeout is very low until we are not performing any bulk operation in it.

Also i don't think once you receive a timeout at client side you will have any control on the server action to abort it , as internally it happens through the fast api call and once invoked they have there own lifecycle.


Regards,

-PJ-

Rank: #21451

Hi PJ, Thanks for your response, so this is how reactive web behave. But i tried setting the server request timeout during run time, but it didn't work also..

Rank: #22932

Hi Cie,

I am facing the same problem, server request timeout  doesn't work. Did you find the solution.

Regards,

Lovish

mvp_badge
MVP
Rank: #50

Hi Cie,

Yes the Sever Request Timeout is to increase the wait time for the http request to complete. The reason of its not working may be because of the Reactive Web behavior . In reactive web the server action will call differently via client side code and as i mentioned , internally these calls happens through the fast rest api .


Regards,

-PJ-

Rank: #166

Hi Cie,

When calling a server action inside a client action, afaik, it is called as a REST API. See Here:


The action you tried 'SetRequestTimeout' will only work for HTTP requests from browser, so you can't use it in your server actions that are being called as a REST API service.


Since the timeouts from the REST service and HTTP requests from browser will be different, because the REST service request will run in other scope than your client action, the timeouts might be different, and the REST service (in it own scope) will not be aware of your timeout in the client request.


I believe this is what is happening...


If this is the case, the only safe way to ensure your client side will not expire before the REST service, is setting the timeout with a value + the timeout of your REST services.

By default the timeout in IIS is:

-> 90 seconds for .NET 1.x.

-> 110 seconds for .NET 2.0 and later.

Knowing that, you can make a test, setting the timeout of your module to a value bigger than 110 seconds, to see if it also changes the client actions timeouts.

Note that each server action will be a different REST service and will have it own timeout. So if in one Client action you call 2 server actions, you must set a timeout bigger than 220 seconds, 3 server actions would be 330 seconds, and so on.


It is just an idea, but might help.


Cheers and Regards,

RR :)