Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

How to tell when mod_proxy backend request timed out?

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


mirkperl at gmail

Sep 18, 2008, 9:17 AM

Post #1 of 3 (396 views)
Permalink
How to tell when mod_proxy backend request timed out?

I'm using mod_perl 2.0.3 with Apache 2.2.9 and mod_proxy for reverse
proxying. Is there a way, from my mod_perl application, that I can
tell when the connection to the backend server in mod_proxy timed out?
I.e., mod_proxy made a connection to the backend, but the backend
didn't respond in the configured number of timeout seconds?

I know that there's the Apache2::RequestRec::request_time variable,
and I can do the simple math to figure out how long ago the request
started, but since mod_proxy does actually know when a timeout
happens, does mod_proxy bubble that info up into something that is
exposed by the mod_perl API anywhere? It would be nice to just have
simple access to an error code, to know whether it was a timeout or
just an aborted connection.

Thanks,
Adam


fred at redhotpenguin

Sep 18, 2008, 10:05 AM

Post #2 of 3 (375 views)
Permalink
Re: How to tell when mod_proxy backend request timed out? [In reply to]

Adam Woodworth wrote:
> I'm using mod_perl 2.0.3 with Apache 2.2.9 and mod_proxy for reverse
> proxying. Is there a way, from my mod_perl application, that I can
> tell when the connection to the backend server in mod_proxy timed out?
> I.e., mod_proxy made a connection to the backend, but the backend
> didn't respond in the configured number of timeout seconds?
>
> I know that there's the Apache2::RequestRec::request_time variable,
> and I can do the simple math to figure out how long ago the request
> started, but since mod_proxy does actually know when a timeout
> happens, does mod_proxy bubble that info up into something that is
> exposed by the mod_perl API anywhere? It would be nice to just have
> simple access to an error code, to know whether it was a timeout or
> just an aborted connection.

I'm not sure if I completely understand your scenario - do you have
mod_proxy enabled apache reverse proxying to mod_perl? If so, you can
use $r->connection->aborted to determine if the connection is invalid.

http://perl.apache.org/docs/2.0/api/Apache2/Connection.html#C_aborted_


perrin at elem

Sep 18, 2008, 10:25 AM

Post #3 of 3 (375 views)
Permalink
Re: How to tell when mod_proxy backend request timed out? [In reply to]

On Thu, Sep 18, 2008 at 12:17 PM, Adam Woodworth <mirkperl[at]gmail.com> wrote:
> I'm using mod_perl 2.0.3 with Apache 2.2.9 and mod_proxy for reverse
> proxying. Is there a way, from my mod_perl application, that I can
> tell when the connection to the backend server in mod_proxy timed out?
> I.e., mod_proxy made a connection to the backend, but the backend
> didn't respond in the configured number of timeout seconds?

I hope you don't mean that you have mod_perl compiled into your
reverse proxy. It should only be in the backend.

I think that mod_proxy delivers a specific error message and status
when it times out, so you can probably use ErrorDocument to specify a
custom page for that.

- Perrin

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.