Bug 8494: Separate writing and completion threads 06/60606/11
authorVratko Polak <vrpolak@cisco.com>
Fri, 21 Jul 2017 10:24:49 +0000 (12:24 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 24 Jul 2017 21:38:12 +0000 (21:38 +0000)
commit8744119235b90d89021567e5f12361d98b823b8f
tree693062d490c42fedec2532d6cea237d2929fcdb7
parent5df3476d858fbf3b6d1dfdd2c4ab723e6c291ab2
Bug 8494: Separate writing and completion threads

If AbstractTransactionHandler uses only one executor thread,
future completion callbacks are delayed by throttling on writes.
CSIT aims to detect RequestTimeoutException within a narrow window,
so a separate executor for callbacks is used now.

The delay would not be that critical, but the problem is the timing
between a scheduled execution which exceeds scheduling gaps. These
seem to hold up normally-submitted tasks, leading to futures never
completing.

Therefore we use two Executors and synchronize state modification
call sites. Hence the two tasks (throttled producer) and future
completions can run concurrently (aside from state synchronization).

Change-Id: I642c5295ab6188b2d7e1b5feae62ab7ef52d41eb
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/AbstractTransactionHandler.java
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/WriteTransactionsHandler.java