Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - ScriptTimeout and executionTimeout do not work

 
Thread Tools Search this Thread
Old 04-29-2005, 03:18 PM   #1
Default ScriptTimeout and executionTimeout do not work


I am trying to make the page execute timeout after 2 seconds.

I first tried using the Server.ScriptTimeout = 2 in the Page_Load() event.
The next line does System.Threading.Thread.Sleep(10000); // 10 second pause

I was expecting the page to timeout with a Request timeout error. However,
it did not timeout and continue to execute for the full 10 seconds.

Next, I tried to use the <httpRuntime> configuration to set the
executionTimeout attribute to 2 like this:

<httpRuntime executionTimeout="2"/>

In the Web.config file. However this did not help either.

How can I force my ASPX page to timeout after 2 seconds?

Thanks,
Arsen V.




Arsen V.
  Reply With Quote
Old 04-30-2005, 07:04 AM   #2
Steven Cheng[MSFT]
 
Posts: n/a
Default RE: ScriptTimeout and executionTimeout do not work

Hi Arsen,

Welcome to ASP.NET newsgroup.
As for the executionTimeout setting for ASP.NET's <httpRuntime>
configuration not work problem. First I should admit that the
documentation on this attribute is really not very clear. The problem is
caused by the following reasons:

1. This setting will take effect only when we set the "debug" to false in
web.config , like:

<compilation
defaultLanguage="c#"
debug="false"
/>

when set to "debug=true" mode, the runtime will ignore the timeout setting.


2. Even we set the debug="false", the executionTimeout will still has some
delay when the value is very small. In fact, it is recommeded that we don't
set the timeout less than 1.5 minutes. And when we set the timeout to less
than 1 minute, the delay will span from 5 secs up to 15 secs. For example,
if we set executionTimeout="5", it may take a bout 15 seconds for the page
to timeout.

Hope helps.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)







  Reply With Quote
Old 05-02-2005, 02:20 PM   #3
Arsen V.
 
Posts: n/a
Default Re: ScriptTimeout and executionTimeout do not work

Hi Steven,

Thanks for the follow up. I will try to test by setting "debug" to "false".

Do you know why Server.ScriptTimeout does not work? Or is it also affected
by the "debug" value in the Web.config file.

Finally, if I want to have the script ALWAYS terminate after 2 seconds, what
can I do? Based on what you say, executionTimeout (and
Server.ScriptTimeout?) will not help... Is there a work around?

Thanks,
Arsen V.

"Steven Cheng[MSFT]" <v-> wrote in message
news:...
> Hi Arsen,
>
> Welcome to ASP.NET newsgroup.
> As for the executionTimeout setting for ASP.NET's <httpRuntime>
> configuration not work problem. First I should admit that the
> documentation on this attribute is really not very clear. The problem is
> caused by the following reasons:
>
> 1. This setting will take effect only when we set the "debug" to false in
> web.config , like:
>
> <compilation
> defaultLanguage="c#"
> debug="false"
> />
>
> when set to "debug=true" mode, the runtime will ignore the timeout

setting.
>
>
> 2. Even we set the debug="false", the executionTimeout will still has some
> delay when the value is very small. In fact, it is recommeded that we

don't
> set the timeout less than 1.5 minutes. And when we set the timeout to

less
> than 1 minute, the delay will span from 5 secs up to 15 secs. For example,
> if we set executionTimeout="5", it may take a bout 15 seconds for the page
> to timeout.
>
> Hope helps.
>
> Thanks & Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
>
>
>
>



  Reply With Quote
Old 05-04-2005, 07:40 AM   #4
Steven Cheng[MSFT]
 
Posts: n/a
Default Re: ScriptTimeout and executionTimeout do not work

Thanks for your reply Arsen,

The reason I didn't suggest use Server.ScriptTimeout property is because
this is a COM interface which is used in classic ASP. The executionTimeout
of ASP.NET is the replacement of ScriptTimeout in asp.net , so we no longer
need to use ScriptTimeout in asp.net.

In addition, as for
==================
have the script ALWAYS terminate after 2 seconds
==================

I'm afraid there is no means in asp.net's runtime setting since the
asp.net's runtime request processing management can't reach this level of
accuracy, 2 seconds is a too small value which may make the performance
very pool to monitor such a small internval. If we do need to let a
certain processing timeout, we can consider put the timeout logic in the
above application code level. For example, if we're executing SqlCommand ,
we can set the sqlcommand 's execution timeout. Or if we are executing a
async call in page code, we can set a timeout for the async call.....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump