[OPNFLWPLUG-393] NullPointerException in .ConnectionConductorImpl.updatePort() Created: 02/Apr/15  Updated: 27/Sep/21  Resolved: 26/Jun/15

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

Type: Bug
Reporter: Igor Kondrakhin Assignee: Michal Rehak
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Duplicate
duplicates OPNFLWPLUG-503 NPE at org.opendaylight.openflowplugi... Resolved
External issue ID: 2941

 Description   

Hello.

I see the next issue during ODL tests: when multiple devices (~ 120 devices) are connecting to ODL controller on ODL start, the following issue is thrown:

2015-04-01 18:32:26,259 | WARN | entLoopGroup-6-2 | DefaultChannelPipeline | 116 - io.netty.common - 4.0.26.Final | An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NullPointerException
at
org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductorImpl.updatePort(ConnectionConductorImpl.java:298)[176:org.opendaylight.openflowplugin:0.1.1000.SNAPSHOT]
at
org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductorImpl.processPortStatusMsg(ConnectionConductorImpl.java:283)[176:org.opendaylight.openflowplugin:0.1.1000.SNAPSHOT]
at
org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductorImpl.onPortStatusMessage(ConnectionConductorImpl.java:275)[176:org.opendaylight.openflowplugin:0.1.1000.SNAPSHOT]
at
org.opendaylight.openflowjava.protocol.impl.core.connection.ConnectionAdapterImpl.consume(ConnectionAdapterImpl.java:303)[174:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at
org.opendaylight.openflowjava.protocol.impl.core.DelegatingInboundHandler.channelRead(DelegatingInboundHandler.java:46)[174:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[115:io.netty.transport:4.0.26.Final]
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)[141:io.netty.codec:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[115:io.netty.transport:4.0.26.Final]
at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)[141:io.netty.codec:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[115:io.netty.transport:4.0.26.Final]
at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)[141:io.netty.codec:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[115:io.netty.transport:4.0.26.Final]
at
io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:150)[142:io.netty.handler:4.0.26.Final]
at
org.opendaylight.openflowjava.protocol.impl.core.IdleHandler.channelRead(IdleHandler.java:39)[174:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)[115:io.netty.transport:4.0.26.Final]
at
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:349)[115:io.netty.transport:4.0.26.Final]
at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)[116:io.netty.common:4.0.26.Final]
at
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[116:io.netty.common:4.0.26.Final]
at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]

The issue is reproducible on Helium and Lithium OpenFlowPlugin versions and caused by racing conditions in ConnectionConductorImpl.
The sessionContext member is not set yet when onPortStatusMessage is called. As result, this.getSessionContext() in method ConnetionConductorImpl.updatePort() returns null:

297: } else

{ 298: this.getSessionContext().getPhysicalPorts().put(portNumber, msg); 299: this.getSessionContext().getPortsBandwidth() 300: .put(portNumber, portBandwidth); 301: }

 Comments   
Comment by Abhijit Kumbhare [ 13/Apr/15 ]

Can be done after M5.

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