Forum Discussion

Patrick_Chang_7's avatar
Patrick_Chang_7
Historic F5 Account
Apr 04, 2008

HTTP::retry help


rule reselect.irule {
   when HTTP_REQUEST {
   set req [HTTP::request]
}
when LB_FAILED {
log local0. "LB Failed for client [IP::client_addr] [LB::server addr] when requested http://[HTTP::host][HTTP::uri]"
   LB::reselect pool a_pool
   HTTP::retry $req
log local0. "Log retried http://[HTTP::host][HTTP::uri] "
}
}

results in

Apr 3 21:11:15 tmm3 tmm3[2274]: Rule reselect.irule : LB Failed for client x.x.x.x when requested http://some.host//some/uri

Apr 3 21:11:15 tmm3 tmm3[2274]: 01220001:3: TCL error: reselect.irule - while executing "HTTP::retry $req"

What would cause this rule to fail. I don't see anything wrong.

5 Replies

  • The reason why it's failing is because "HTTP::retry" is only valid for the following events : HTTP_RESPONSE, HTTP_RESPONSE_DATA. It doesn't work under LB_FAILED event.

     

     

     

     

  • Patrick_Chang_7's avatar
    Patrick_Chang_7
    Historic F5 Account
    Thanks. On a side note, someone needs to fix the code example under LB::reselect

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LB__reselect.html
  • One piece of warning with HTTP::retry

     

     

    If you try to re send a POST request it won't work. you'll lose the payload with the parameters :'(