Forum Discussion

Oz_Ayd_69699's avatar
Oz_Ayd_69699
Icon for Nimbostratus rankNimbostratus
Jun 30, 2006

HTTP:retry Web Service problem

Problem 1. The following HTTP:retry example (from the iRules documentation) does not work (LTM version 9.2.3). The LB::reselect is not allowed in a HTTP_RESPONSE. Is this correct? How would you overcome this restriction.

 

 

when CLIENT_ACCEPTED {

 

set i 0

 

}

 

when HTTP_REQUEST {

 

log "Request [HTTP::request_num]"

 

set request [HTTP::request]

 

}

 

when HTTP_RESPONSE {

 

log "Response [HTTP::request_num]"

 

if {[HTTP::status] == 404}{

 

if {[incr i] < 3} {

 

LB::reselect

 

HTTP::retry $request

 

}

 

} else {

 

set i 0

 

}

 

}

 

 

Problem 2. If the request is for a Web Service and a 404 error occurs (assume load balancing is round robin), a 400 Bad Request

 

error is returned. Does the Web Service request HTTP header need to be altered prior the HTTP:retry? Does HTTP::retry work with Web Services?

 

 

 

 

 

2 Replies

  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    Yes you should be able to do this but with one caveat. The HTTP::request rule does not include the HTTP request body so if your request is a POST method, you will have to collect the POST data and append it to the request.

     

     

    BTW, doing a retry on a 404 or on any bad client requests should be carefully considered; especially if there is a possibility of malicious client.
  • Thanks for the clarification.

     

    How do you append the request body to the request header prior to the HTTP:retry?