[BGPCEP-629] PCEP topology provider ServerSessionManager not synchronized and causing concurrent problem Created: 09/Feb/17  Updated: 03/Mar/19  Resolved: 02/Mar/17

Status: Resolved
Project: bgpcep
Component/s: PCEP
Affects Version/s: Bugzilla Migration
Fix Version/s: Bugzilla Migration

Type: Bug
Reporter: Kevin Wang Assignee: Kevin Wang
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: 7768

 Description   

A java.util.ConcurrentModificationException is possible to happen due to the close() method of ServerSessionManager is not synchronized. The situation mostly likely will happen during a controller reboot. It may also happen when a PCEP config is updated.

When a controller is restarted, or the PCEP topology/configuration is changed, it is trying to modify the session manager's node map. However, if a PCEP session is opened during that time, a concurrent issue may happen.

Karaf log attached:

2017-02-01 21:20:33,282 | INFO | oupCloseable-3-8 | AbstractPCEPSessionNegotiator | 205 - org.opendaylight.bgpcep.pcep-impl - 0.5.2.Beryllium-SR2 | PCEP session with [id: 0xfb89d73b, /10.0.0.125:14432 => /10.74.1.6:4189] started, sent proposal Open [_deadTimer=120, _keepalive=30, _sessionId=0, _tlvs=Tlvs [augmentation=[Tlvs1 [_stateful=Stateful [_lspUpdateCapability=true, augmentation=[Stateful1 [_initiation=true], Stateful1 [_deltaLspSyncCapability=true, _includeDbVersion=true, _triggeredInitialSync=true, _triggeredResync=true]]]]]], augmentation=[]]
2017-02-01 21:20:33,286 | ERROR | config-pusher | PCEPTopologyProvider | 218 - org.opendaylight.bgpcep.pcep-topology-provider - 0.5.2.Beryllium-SR2 | Failed to shutdown session manager
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:922)[:1.7.0_76]
at java.util.HashMap$ValueIterator.next(HashMap.java:950)[:1.7.0_76]
at org.opendaylight.bgpcep.pcep.topology.provider.ServerSessionManager.close(ServerSessionManager.java:164)
at org.opendaylight.bgpcep.pcep.topology.provider.PCEPTopologyProvider.close(PCEPTopologyProvider.java:96)
at org.opendaylight.controller.config.spi.AbstractModule.getInstance(AbstractModule.java:76)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_76]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_76]
at org.opendaylight.controller.config.manager.impl.dependencyresolver.DependencyResolverManager$ModuleInvocationHandler.handleInvocation(DependencyResolverManager.java:149)
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
at com.sun.proxy.$Proxy20.getInstance(Unknown Source)
at org.opendaylight.controller.config.manager.impl.ConfigTransactionControllerImpl.secondPhaseCommit(ConfigTransactionControllerImpl.java:421)
at org.opendaylight.controller.config.manager.impl.ConfigRegistryImpl.secondPhaseCommit(ConfigRegistryImpl.java:287)
at org.opendaylight.controller.config.manager.impl.ConfigRegistryImpl.commitConfig(ConfigRegistryImpl.java:227)
at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_76]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_76]
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)[:1.7.0_76]
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_76]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_76]
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)[:1.7.0_76]
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)[:1.7.0_76]
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)[:1.7.0_76]
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)[:1.7.0_76]
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)[:1.7.0_76]
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)[:1.7.0_76]
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)[:1.7.0_76]
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)[:1.7.0_76]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)[:1.7.0_76]



 Comments   
Comment by Claudio David Gasparini [ 02/Mar/17 ]

Hi Kevin, remember to attach the patch's to the bug, so they can be tracked.
And don't close it until its fixed on all branches.

Regards,

Master
https://git.opendaylight.org/gerrit/#/c/52328/

Boron
https://git.opendaylight.org/gerrit/#/c/52329/4

Be
https://git.opendaylight.org/gerrit/#/c/52330/3

Generated at Wed Feb 07 19:13:39 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.