Forum Discussion

roldancer_11066's avatar
roldancer_11066
Icon for Nimbostratus rankNimbostratus
Oct 04, 2012

How to capture this message "Connection Interrupted"

Hi All,

 

I'm new in this kind of technology (F5-IRule), may be this is a very basic question ... I'm sorry about that, but I have a problem that I could not resolve.

 

I have changed the IP:idle_timeout parameter using this small IRule code ...

 

when HTTP_REQUEST {

 

 

 

IP::idle_timeout 10

 

...

 

...

 

 

Everything works ok, but the after 10 seconds I receive in my web browser the following error message:

 

 

"Connection Interrupted

 

The connection to the server was reset while the page was loading.

 

The network link was interrupted while negotiating a connection. Please try again."

 

 

Is there any way using an IRule to capture the timeout/Interrupted error and redirect to a maintenance page ?

 

 

Many thanks.

 

 

 

 

 

 

 

 

 

 

 

10 Replies

  • Why are you using IP::idle_timeout? It might be helpful to explain what you are doing, what problem is it solving?

     

     

    It sounds like after 10 seconds of idleness, your iRule is closing the connection, right? You don't need to detect that, you just need to stop doing it in the first place by removing this IP::idle_timeout statement.

     

     

    Thanks,

     

    Mohamed.

     

  • Hi Mohamed,

     

    We don't want long running requests, that's the reason why we want to configure some timeouts.

     

     

    Cheers.
  • OK. I believe your question is not basic then. Maybe someone will point you to something better, maybe simpler, but you could start playing with the example here:

     

     

    https://devcentral.f5.com/wiki/iRules.after.ashx

     

     

  • I'd suggest it would be easier to create a custom TCP Profile with a low idle timeout and assign it to the Virtual Server: Protocol Profile (Server). This will maintain the default timeout of 300s on the client side (assuming a standard VS and the default tcp profile) but allow you to reduce the server side idle timeout, without causing errors on the client.

     

     

    If a high number of server side connections is the root of your requirement you might find OneConnect would be useful too.
  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account
    You can not capture the error as it is the ltm that is sending a reset to the client. The Client browser is the one displaying the error message. You could play with the iRule after command, just a thought but if you do a after 10000 then send a HTTP::response to the maint page.

     

     

    Look at the example on the following page.

     

     

    https://devcentral.f5.com/wiki/iRules.after.ashx
  • Hi All,

     

    I created a TCP profile for the server side, I only changed the idle timeout field, but I'm still receiving the same error message.

     

    I was looking at the after commanda page but I don't understand how to use it for my case (capture the "Connection Interrupted" message and resend the request to a friendly/maintenance page).

     

     

    many thanks for your help.
  • You would need to not set the idle timeout, or at least set it up higher than what you need, then use an iRule to track every connection and measure its idleness! and do whatever you want with it when it has been idle for too long.

     

     

    Like I said, this is not a simple question. You could also call F5 Support and submit a request for enhancement To add an Event for IP idle timeout expired.
  • The bigger problem I think is what would you do once the event happened? Can you just send an HTTP redirect? what is the client is not expecting HTTP redirects.. what if it is waiting for JSON?
  • Do you remove the iRule when you tested with the shorter client side timeout? If not, please do so and test.
  • I may not be completely clear on your objective, but you said that you don't want long running requests. HTTP traffic, by default, is fairly transient and I believe the typical TCP idle timeout is somewhere around 3-5 seconds. So i'm guessing you're talking about requests that include some amount of traffic that exceeds a given threshold (file upload, Ajax comet, etc.) I think in this case you could set an after timer at the beginning of each HTTP request, and then unset it in the response event. Then you could trigger an HTTP redirect or response if the timer expires. That may also trigger the timer if the response takes too long. And it wouldn't prohibit a lot of small requests.

     

     

    Just a thought.