Forum Discussion

Jimmy_Orkin_437's avatar
Jimmy_Orkin_437
Icon for Nimbostratus rankNimbostratus
Apr 25, 2013

Query connection status when node fails

I am new to iRules. I am writting an iRule to track and limit connections to nodes. The connections are UDP. I am logging information about the connections in the SERVER_CLOSED event.

 

When the node fails and SERVER_CLOSED is called, My references to IP::client_addr and UDP::client_port cause a TCL error listed below:

 

TCL error: /Common/sgng-count-policing-v2.0 - no clientside connection established (line 8) invoked from within "IP::client_addr"

 

The runtime error is causing my tracking counts to get out of sync with reality.

 

Is there a way for me to determine that the connection is not valid so that I can avoid my references to IP::client_addr and UDP::client_port so that I do not get a runtime TCL error?

 

Thanks,

 

Jimmy

 

3 Replies

  • I figured a way out my problem. I now understand the lifetime of the variables and that they live between events. I will store the data I need from the SERVER_CONNECTED event.

     

    I still would like to know what commands can be called in the SERVER_CLOSED event when the session goes down abnormally.

     

    Thanks,

     

    Jimmy

     

  • I don't think there is a way of detecting when a session is closed normally or otherwise unfortunately. I'd love to be corrected if anyone knows better?
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    We have no solid way of knowing whether or not a connection was closed "properly", for the most part. All we see is a session termination, usually, and that triggers our closed event(s) to fire. Unless you are doing some very specific analysis and interrogation of the session in flight, you probably won't be able to tell what is a "proper" close vs. an error.

     

     

    Colin