[OPNFLWPLUG-695] OFP - Reuse Threads using ThreadPool in ConnectionManagerImpl.java Created: 19/May/16  Updated: 27/Sep/21  Resolved: 23/Jun/16

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

Type: Bug
Reporter: Jozef Slezák Assignee: Jozef Slezák
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 5925

 Description   

Stop instantiating new thread pool with one thread for handshake after switch connected. Rather prepare threadpool while starting OFP and reuse threads.

public void onSwitchConnected(final ConnectionAdapter connectionAdapter) {
...
final ThreadPoolLoggingExecutor handshakePool = createHandshakePool(



 Comments   
Comment by Tomas Slusny [ 24/May/16 ]

GERRIT: https://git.opendaylight.org/gerrit/#/c/39305/1

Comment by Shigeru Yasuda [ 22/Jun/16 ]

(In reply to Tomas Slusny from comment #1)
> GERRIT: https://git.opendaylight.org/gerrit/#/c/39305/1

After this patch is merged, Li plugin dumps the following stack trace to karaf console every time a new OF session is accepted.

Exception in thread "Thread-221" java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@6d677829 rejected from org.opendaylight.openflowplugin.openflow.md.core.ThreadPoolLoggingExecutor@28041e93[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.opendaylight.openflowplugin.impl.connection.listener.ConnectionReadyListenerImpl.onConnectionReady(ConnectionReadyListenerImpl.java:51)
at org.opendaylight.openflowjava.protocol.impl.core.connection.ConnectionAdapterImpl$1.run(ConnectionAdapterImpl.java:185)
at java.lang.Thread.run(Thread.java:745)

A new thread pool seems to be shared with all OF sessions. So HandshakeContextImpl should never shut down the thread pool passed to constructor.

This patch will fix this bug.

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

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