Forum Discussion
disable irule process for the request not for the whole tcp connection
- Jul 26, 2015
Understood this topic is discussing some race conditions applied on iRule http events;
client 1 --> http request1 --> F5 --> http request1 --> server client 1 --> http request2 --> F5 --> http request2 --> server client 1 --> http request3 --> F5 --> http request3 --> server client 1 <-- http request1 <-- F5 <-- http response1 <-- server client 1 <-- http request2 <-- F5 <-- http response2 <-- server client 1 <-- http request3 <-- F5 <-- http response3 <-- server
From LTM perspective, LTM will not process the subsequent request (but rather put it on the request queue instead)until first response is back from backend pool memeber.
Even pipelining is enabled on client side and multiple requests come in at same time, LTM will still serialize them and process them according to the sequence (FIFO).
So in our case, variable has been set in request 1 will not be messed up even request 2 comes in earlier than response 1.
So you are expecting the following:
- client 1 --> http request1 --> F5 --> http request1 --> server
- client 1 --> http request2 --> F5 --> http request2 --> server
- client 1 --> http request3 --> F5 --> http request3 --> server
- client 1 <-- http request1 <-- F5 <-- http response1 <-- server
- client 1 <-- http request2 <-- F5 <-- http response2 <-- server
- client 1 <-- http request3 <-- F5 <-- http response3 <-- server
And you want to set a variable for http request 1 to use in http response 1 and not have http request 2 mess the variable up?
When pipelining is use http responses must be sent int request order that is using the above response 3 can not be sent before response 1 and 2 are sent.
Since variables are per connection what I would suggest is you number the variables. Something along the lines: Please note I have NOT tested this. If iRules (or TCL) had a FIFO stack/queue function you could use that and it would be easier. The only time I know there would be an issue is if a HTTP request and HTTP response were being processed at almost the same exact time.
when CLIENT_ACCEPTED {
set seq = 0
}
when HTTP_REQUEST {
set $seq = $seq + 1
set var.$seq = "to something"
}
when HTTP_RESPONSE {
if {$seq = 1 } then {
"do something with $var.$seq"
$seq = 0
}
else {
set invseq = 1
"do something with $var.$invseq"
while {$seq > 1} {
set $prev = $invseq + 1
set $var.$invseq = $var.$prev
set $seq = $seq - 1
}
}
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com