[CONTROLLER-1551] ConcurrentModificationException at karaf.FeaturesServiceImpl at opendaylight.controller.configpusherfeature...FeatureConfigPusher Created: 22/Sep/16 Updated: 25/Jul/23 Resolved: 05/Jul/17 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | config |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Claudio David Gasparini | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| External issue ID: | 6787 | ||||||||
| Description |
|
ConcurrentModificationException observed when installing bgpcep (master branch) steps to reproduce it: 2016-09-22 16:32:50,282 | WARN | r - ConfigPusher | FeatureConfigPusher | 137 - config-persister-feature-adapter - 0.6.0.SNAPSHOT | Karaf featuresService.listInstalledFeatures() has thrown an exception, retry 0 |
| Comments |
| Comment by Claudio David Gasparini [ 22/Sep/16 ] |
|
karaf.log |
| Comment by Claudio David Gasparini [ 22/Sep/16 ] |
|
Attachment karaf.log has been added with description: karaf.log |
| Comment by Juraj Veverka [ 24/Jan/17 ] |
|
ConcurrentModificationException observed when installing odl features like odl-restconf which trigers installation of other dependent odl features. 2017-01-24 22:04:02,935 | INFO | l for user karaf | DataObjectToJsonConverter | 338 - tech.pantheon.visibilitypackage.topologyutils.vp-topology-utils - 0.1.0.SNAPSHOT | Mapping service built |
| Comment by Michael Vorburger [ 15/Mar/17 ] |
|
Just saw this as well (in netvirt/vpnservice/distribution/karaf on feature:install odl-netvirt-openstack; not related to actual feature being installed) .. not reliably reproducible, as these kinds of bugs typically go, of course. I'm wondering if this is missing synchronization in Karaf's FeaturesServiceImpl or ODL's FeatureConfigPusher? If Karaf's FeaturesService is not meant to be thread safe, but if FeatureConfigPusher can run concurrently (for config of different bundles?), then we probably should ourselves synchronize when we use it? That's not that hard to do... I'll see if I can propose a Gerrit. |
| Comment by Michael Vorburger [ 15/Mar/17 ] |
| Comment by Tom Pantelis [ 15/Mar/17 ] |
|
In the 3.0.8 version of FeaturesServiceImpl, the 'installed' Map isn't synchronized. The master version at https://github.com/apache/karaf/blob/master/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java appears to be correctly synchronized/thread-safe. |
| Comment by Michael Vorburger [ 15/Mar/17 ] |
|
> the 3.0.8 version of FeaturesServiceImpl (...) The master version OK, then let's say that properly resolving this bug depends on Karaf 4 upgrade I'll try to adjust c/53341 with an ugly workaround hack in the mean time.. |
| Comment by Michael Vorburger [ 15/Mar/17 ] |
|
Oh... hang on, small confusion here.. the code in FeatureConfigPusher actually already does handle this with a retry logic! BUT: (a) As three people independently reported this, not understanding that this WARN with the "retry 0" at the end does not actually indicate a problem, including current 2 controller committers not being aware of this, I would suggest that it is wrong to print a WARN log with a scary looking exception if it's "just" retrying - there should be no log (or only a DEBUG) - but an ERROR if it fails after retrying. (b) On looking at this code more closely, I've also found a 2nd place where I guess this could happen and should be handled - in FeatureConfigPusher's pushConfig using featuresService.getFeature. I'll change the Gerrit to do both (a) and (b) ... |
| Comment by Michael Vorburger [ 15/Mar/17 ] |
|
This, from the current implementation, also seems a bit stupid: private static final int MAX_RETRIES = 100; I'm going to change it to: private static final int MAX_RETRIES = 10; |
| Comment by Michael Vorburger [ 15/Mar/17 ] |
|
> (b) On looking at this code more closely, I've also found a 2nd place where I > guess this could happen and should be handled - in FeatureConfigPusher's I've ignored this, for now; we'll handle it some other time, maybe. PS: Do we have a generic Retryer utility? |
| Comment by Michael Vorburger [ 15/Mar/17 ] |
|
> PS: Do we have a generic Retryer utility? org.opendaylight.genius.datastoreutils.TaskRetryLooper |
| Comment by Tom Pantelis [ 04/Jul/17 ] |
|
I believe this was fixed a few months ago - also shouldn't be an issue with karaf 4. |
| Comment by Michael Vorburger [ 05/Jul/17 ] |
|
> I believe this was fixed a few months ago yes; https://git.opendaylight.org/gerrit/#/c/53341/ removed the confusing WARN log. |