Forum Discussion

Alan_Sha's avatar
Alan_Sha
Icon for Nimbostratus rankNimbostratus
Oct 31, 2005

How to keep the client connection when LB_FAILED?

Hi,

 

 

I need some help on the following scenario.

 

 

I have been maintaining a persistent TCP connection between a client application and Big IP. The client application is sending requests continously to Big IP while Big IP re-routes each request via iRule accordingly. Typically, the client will send one request and wait for the reply before it sends another one. However, in the event of the destination server being unreachable, I want to have Big IP drop the current package after a number of attempts to reconnect, then wait for a new one coming in and process it. I have tried to write some error handling codes in LB_FAILED event, but it appears that once I stopped calling LB::reselect in the LB_FAILED event, the client to Big IP connection will be immediately closed. That's something that I don't want to happen. I want to keep the connection alive all the time and the traffic keeps flowing.

 

 

Below is my codes for LB_FAILED event. What can I do after I stop calling LB::reselect to keep the connection and continue to process any subsequent request? Any suggestion?

 

 

when LB_FAILED {

 

set connRetry [expr {$connRetry + 1}]

 

if { $connRetry < $maxAttempts } {

 

log local0.error "Conn. to [IP::server_addr] failed. Retrying..."

 

LB::reselect

 

}

 

}

 

 

 

Thanks,

 

Alan

 

12 Replies