Forum Discussion

Pranay9127_3037's avatar
Pranay9127_3037
Icon for Nimbostratus rankNimbostratus
Oct 23, 2017

HTTP::close timing out

My goal is to close the connection once sending the 200 response. I have created this iRule, however for some reasons its not working. app is observing timeouts once this rule applied to the virtual. Any inputs are appreciated!

when HTTP_REQUEST { if { [string tolower [HTTP::path]] equals "Healtch-Check-URL" } { if { [active_members [LB::server pool]] >= 1 } { HTTP::respond 200 content { OK } HTTP::close }

        else {
            HTTP::respond 500 content {
                NOT_OK
            }
            HTTP::close
        }

    }
    elseif { [active_members POOL_NAME] == 0 } {
        if { [HTTP::header exists x-gtm-dc-failure] }  {
            return
        }
        HTTP::header insert x-gtm-dc-failure true
    }
} 
  • Once the HTTP::respond is executed, you cannot further modify the response (as HTTP::close attempts to do).

    Modify your HTTP::respond to set the

    Connection: close

    i.e

    HTTP::respond 200 content { OK} "Connection" "close"

    or

    HTTP::respond 500 content {NOT_OK} "Connection" "close"