Forum Discussion
Wil_Schultz_101
Nimbostratus
Jul 30, 2007Reselect pool on status code 500 or above...
So we run some Tomcat servers, when we undeploy the server will send a 503 that states that the application is unavailable. I do have a check that looks for a static page every 5 seconds and fails at 16 seconds, however for that 16 second period people from the outside world see this 503 error.
I would like to set it up to where any status code above 500 reselects but I seem to have an order of operation problem. Maybe someone that i saner than I might have a suggestion?
Here is what I have so far:
when HTTP_RESPONSE {
if { [HTTP::status] > 499 }{
set ::hostfailed 1
log local0. "Setting up ::hostfailed."
}
}
when LB_SELECTED {
if { $::hostfailed == 1 } {
LB::detach
LB::reselect [LB::server pool]
log local0. "LB failed, re-load balancing to pool."
}
}
This irule fails because LB_SELECTED us called after HTTP_RESPONSE and ::hostfailed is not set.
22 Replies
- sam_81897
Nimbostratus
How am I buffering the request? The client should re-initiate the request for a 307. - nitass
Employee
i understand Aaron meant using HTTP::redirect or HTTP::respond might be better than buffering payload and retrying it (since HTTP::request does not contain payload).
HTTP::request
http://devcentral.f5.com/wiki/iRules.HTTP__request.ashx
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects