Comment 10 for bug 1714371

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/36224
Committed: http://github.com/Juniper/contrail-controller/commit/23f0ddaa2b26405fa368c38cfde9417386fd6e66
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit 23f0ddaa2b26405fa368c38cfde9417386fd6e66
Author: Naveen N <email address hidden>
Date: Wed Oct 4 16:08:26 2017 +0530

* Read reverse flow entry after acquiring the lock

In case of short lived TCP session using same 5 tuple we might
end up accesssing a reverse flow entry which might be already deleted
and present in free list. Below set of events lead to this issue

1. F1 and R1 flow are added to flow table
2. R1 is written to vrouter
3. F1 is written to vrouter
4. R1 flow add response is received, triggering update of
F1(not needed now as reverse flow index is not written to
kernel?)
5. In the meantime flow is evicted in vrouter, hence flow
update for F1 would result in error from vrouter resulting in short flow
6. Since F1 is shortflow Flow delete gets enqueued
7. Since R1 is evict marked, flow evict gets enqueued
8. Both event F1 and R1 delete and evict event can run in
parallel,and hence reverse flow pointer obtained before FLOW
lock could be invalid, hence read back the same

Was able to simulate the same in UT, UT is disabled as it need some
instrumentation to run it to hit the issue

Change-Id: I368f465f9d446b43dfe0e4baa547d8c8cbfd6840
Closes-bug: #1714371