BUG-8402: fix transmit accounting 52/57152/6
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 May 2017 14:49:42 +0000 (16:49 +0200)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 17 May 2017 11:41:23 +0000 (11:41 +0000)
commitfe69101801085580f2fe72762abea5c5fa83d978
treee13ab1d55c156f578094d1a62fba77256bc6278b
parentce270209c52ec43df3e61b49244f8ddc796ecd0f
BUG-8402: fix transmit accounting

CSIT has shown that during burst activity and leader movement
we can lose track of messages and the requests can arrive misordered.

As it turns out TransmitQueue.complete() transmit-on-response code
path fails to properly move the request to the in-flight queue.

Furthermore, opportunistic sending TransmitQueue.enqueue() could cause
message reordering if for some reason we have pending requests and
available transmit slot.

Fix this sharing the codepaths and making the TransmitQueue.enqueue()
check pending queue emptiness.

Change-Id: I2daf3d8b198e83c6f50f4a2f43b9e4c3cc091187
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/TransmitQueue.java
opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/TransmittingTransmitQueueTest.java