[OPNFLWPLUG-223] Performance: blocking in QueueKeeperHarvester Created: 30/Jul/14  Updated: 27/Sep/21  Resolved: 18/Aug/14

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File OFP-20140730.snapshot.xz    
External issue ID: 1455

 Description   

Profiling shows about 20 seconds spent between ping() and run(), as evident in the captured profile (YJP 2014 EAP) during a 100 second run.

At first glance, two things jump out: lock should be final and 'starving' should be volatile.

Looking at the logic, I have to wonder if java.util.concurrent.CyclicBarrier wouldn't be more appropriate as opposed to lock:

0) initialize barrier, parties=2
1) run: when starved, set atomically starving to true, barrier.await()
2) ping: check starved, if it's true, barrier.await()
3) run: upon leaving barrier, set starting to false



 Comments   
Comment by Robert Varga [ 30/Jul/14 ]

Attachment OFP-20140730.snapshot.xz has been added with description: Profiling trace

Comment by Robert Varga [ 30/Jul/14 ]

Also, a CountDownLatch may be used instead of the barrier (just glancing through docs).

Comment by Robert Varga [ 30/Jul/14 ]

https://git.opendaylight.org/gerrit/9508

Generated at Wed Feb 07 20:31:53 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.