[OPNFLWPLUG-580] IllegalArgumentException in statistics manager getGeneratedUUIDForNode() call Created: 08/Dec/15  Updated: 27/Sep/21  Resolved: 19/Jun/17

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

Type: Bug
Reporter: Srini Seetharaman Assignee: Shivani Pathak
Resolution: Won't Do 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: 4738

 Description   

The current code meant to avoid NPE for the getGeneratedUUIDForNode() call leads to IllegalArgumentException because the UUID class is unhappy with string "invalid-uuid". So, might as well return null instead of doing bad workaround.

Following exception was thrown on my screen.

Exception in thread "pool-30-thread-1" java.lang.RuntimeException: java.lang.IllegalArgumentException: Invalid UUID string: invalid-uuid
at com.lmax.disruptor.FatalExceptionHandler.handleEventException(FatalExceptionHandler.java:45)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:147)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Invalid UUID string: invalid-uuid
at java.util.UUID.fromString(UUID.java:194)
at org.opendaylight.openflowplugin.applications.statistics.manager.impl.StatisticsManagerImpl.getGeneratedUUIDForNode(StatisticsManagerImpl.java:399)
at org.opendaylight.openflowplugin.applications.statistics.manager.impl.StatListenCommitGroup$2.generatedUUIDForNode(StatListenCommitGroup.java:206)
at org.opendaylight.openflowplugin.applications.statistics.manager.StatisticsManager$StatDataStoreOperation.<init>(StatisticsManager.java:85)
at org.opendaylight.openflowplugin.applications.statistics.manager.impl.StatListenCommitGroup$2.<init>(StatListenCommitGroup.java:167)
at org.opendaylight.openflowplugin.applications.statistics.manager.impl.StatListenCommitGroup.onGroupFeaturesUpdated(StatListenCommitGroup.java:167)
at org.opendaylight.yangtools.yang.binding.util.NotificationListenerInvoker.invokeNotification(NotificationListenerInvoker.java:91)
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMNotificationListenerAdapter.onNotification(BindingDOMNotificationListenerAdapter.java:44)
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouterEvent.deliverNotification(DOMNotificationRouterEvent.java:50)
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter$1.onEvent(DOMNotificationRouter.java:68)
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter$1.onEvent(DOMNotificationRouter.java:65)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
... 3 more
Exception in thread "Thread-1216" java.util.concurrent.RejectedExecutionException: Task org.opendaylight.openflowplugin.openflow.md.core.HandshakeStepWrapper@10e0fdcd rejected from org.opendaylight.openflowplugin.openflow.md.core.ThreadPoolLoggingExecutor@14df6b09[Shutting down, pool size = 0, active threads = 0, queued tasks = 1, completed tasks = 0]
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 org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductorImpl.onConnectionReady(ConnectionConductorImpl.java:456)
at org.opendaylight.openflowjava.protocol.impl.core.connection.ConnectionAdapterImpl$3.run(ConnectionAdapterImpl.java:472)
at java.lang.Thread.run(Thread.java:745)



 Comments   
Comment by Shivani Pathak [ 17/Dec/15 ]

String passed in the fromString() method of java.util.UUID should be in a particular format to avoid the exception.

ex. Hexadecimal representation of the plain string should be formatted into a UUID formatted string (standardized to 8-4-4-4-12 hex digits) and then passed to fromString() method.

Instead of invalid-uuid, UUID formatted string should be passed.

Comment by Srini Seetharaman [ 17/Dec/15 ]

When the UUID is indeed unavailable, there is no way to use a valid UUID. So, might as well return null.

Here is a simple patch: https://git.opendaylight.org/gerrit/#/c/30975/

Comment by Shivani Pathak [ 18/Dec/15 ]

(In reply to Srini Seetharaman from comment #2)
> When the UUID is indeed unavailable, there is no way to use a valid UUID.
> So, might as well return null.
>
> Here is a simple patch: https://git.opendaylight.org/gerrit/#/c/30975/

UUID (java.util.UUID) is a class name so how can it be unavailable ?

Comment by Shivani Pathak [ 11/Jan/16 ]

Submitted a patch https://git.opendaylight.org/gerrit/32333

Comment by Jozef Bacigal [ 19/Jun/17 ]

He-desing won't be updated anymore. Closing

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