Serge_M__252_ll
Jan 18, 2016Nimbostratus
Http::retry after timeout (again)
Hi,
this is a reiteration of this question
in short the Problem is: i need to retry a Server connection if it takes longer than x to process (eg Server connection died mid request, congestions, to much cats...). The idea so far was to use "after" in the http request, and the do a http::retry or a lb::reselect. But neither works HTTP::retry only works in HTTP_RESPONSE which i never reach, since my request are processed to slowly(or cats) and LB::reselect does not retry the request. I tried inband monitors, but they dont seem to work the way i expected
any suggestions?
best regards Serge
P.S. The Solution so far
rule myrule {
when RULE_INIT {
set static::response_timeout 5
}
when HTTP_REQUEST {
log local0. "Received request, beginning response monitor interval. [clock seconds]"
set monitor_id [\
after $static::response_timeout {
does not work in this context
HTTP::retry [HTTP::request]
log local0. "Timeout $static::response_timeout milliseconds elapsed without server response. [clock seconds]"
}\
]
}
when HTTP_RESPONSE {
this is never reached
log local0. "Received server response."
if {[info exists monitor_id]} {
log local0. "Canceling after script with id $monitor_id"
after cancel $monitor_id
}
}
}