LB::Server not seeing pool command results?
I have two farms - "webha" for static pages, and "webha-cgi" for cgi scripting. I'm looking at the HTTP::path for things like ".cgi" and sending those to the cgi farm. It seems to be working - but I get weird results back from LB::server.
Specifically - sometimes, when I do this (I set $default_pool in CONNECTION_ACCEPT):
now route the traffic to the appropriate pool
log local0. "Before switch, pool is [LB::server pool] (default $default_pool) for [HTTP::host]"
set ourmatch "nothing"
switch -glob [string tolower [HTTP::path]] {
/cgi-bin/* { set ourmatch "cgi-bin" }
*.cgi { set ourmatch "cgi" }
}
if {$ourmatch ne "nothing"} { set newpool $default_pool-cgi }
else { set newpool $default_pool }
pool $newpool
log local0. "matched $ourmatch - pool is [LB::server pool] (newpool is $newpool) for [HTTP::host] [HTTP::uri]"
Sometimes - 1 out of 50 maybe - I get the old pool, even though we've just set a new pool. Specifically, we'll do "pool webha" and the followup log says "pool is webha-cgi" - but when I go look, the request *actually* did land on the webha pool servers.
Dec 13 13:58:45 local/tmm info tmm[5290]: Rule webha_app_director : matched nothing - pool is webha-cgi (newpool is webha) for www.not-the-domain.com /Admin/admin.css
So - "LB::server pool" is giving back the wrong info, in some cases, where it's just been set with a new pool. The new pool actually *works* - this appears to be a reporting issue with LB::server. If I used that to do work with, it would cause bugs, presumably...
Anyway - thought I'd share, in case someone else is searching for this sort of behavior. If anyone can explain how this could happen, I'm all ears; I'd think the update done by "pool" would be atomic, and any followup calls to LB::server would give back the new pool - but maybe we're caching results or something? Is a puzzlement.
-- Tom Bortels, reluctant iRules d00d