Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrentModificationException while destroying single resources #1096

Closed
tfr42 opened this issue Oct 29, 2020 · 3 comments · Fixed by #1097 · May be fixed by #1099
Closed

ConcurrentModificationException while destroying single resources #1096

tfr42 opened this issue Oct 29, 2020 · 3 comments · Fixed by #1097 · May be fixed by #1099
Labels
bug error issue and bug (fix) console deegree administration console

Comments

@tfr42
Copy link
Member

tfr42 commented Oct 29, 2020

Currently the integration tests fail in module "deegree-resource-deps-tests" due to the following errors:

16:15:38]  INFO: [CRSManager] Clear CRS store and transformation map
[16:15:38]  INFO: [CRSManager] --------------------------------------------------------------------------------
[16:15:38]  INFO: [CRSManager] No 'crs' directory -- use default configuration.
[16:15:38]  INFO: [CRSManager] --------------------------------------------------------------------------------
[16:15:38]  INFO: [CRSManager] Setting up crs store 'default' from file 'file:/var/jenkins_home/workspace/deegree-build-upload/deegree-core/deegree-core-cs/target/deegree-core-cs-3.4.14-SNAPSHOT.jar!/org/deegree/cs/persistence/default.xml'...
[16:15:38]  INFO: [CRSManager] Registering global crs store with id 'default', type: 'org.deegree.cs.persistence.deegree.d3.DeegreeCRSStore'
[ERROR] Tests run: 8, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 8.576 s <<< FAILURE! - in org.deegree.workspace.SimpleSqlFeatureStoreTest
[ERROR] testDestroyInitializeSingle(org.deegree.workspace.SimpleSqlFeatureStoreTest)  Time elapsed: 0.966 s  <<< ERROR!
java.util.ConcurrentModificationException
	at org.deegree.workspace.SimpleSqlFeatureStoreTest.testDestroyInitializeSingle(SimpleSqlFeatureStoreTest.java:156)

[ERROR] testDestroySingle(org.deegree.workspace.SimpleSqlFeatureStoreTest)  Time elapsed: 0.976 s  <<< ERROR!
java.util.ConcurrentModificationException
	at org.deegree.workspace.SimpleSqlFeatureStoreTest.testDestroySingle(SimpleSqlFeatureStoreTest.java:144)

[ERROR] testReinitializeChain(org.deegree.workspace.SimpleSqlFeatureStoreTest)  Time elapsed: 0.665 s  <<< ERROR!
java.util.ConcurrentModificationException
	at org.deegree.workspace.SimpleSqlFeatureStoreTest.testReinitializeChain(SimpleSqlFeatureStoreTest.java:170)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   SimpleSqlFeatureStoreTest.testDestroyInitializeSingle:156 » ConcurrentModification
[ERROR]   SimpleSqlFeatureStoreTest.testDestroySingle:144 » ConcurrentModification
[ERROR]   SimpleSqlFeatureStoreTest.testReinitializeChain:170 » ConcurrentModification
[INFO] 
[ERROR] Tests run: 8, Failures: 0, Errors: 3, Skipped: 0
@tfr42 tfr42 added the bug error issue and bug (fix) label Oct 29, 2020
@lgoltz
Copy link
Contributor

lgoltz commented Nov 3, 2020

Testfailures are caused by a change in https://github.com/deegree/deegree3/pull/1058/files#diff-41768028a4f464394c40f29346f004f1121204b40501c7e168d6ee04fa592d98
Adds: graph.removeNode( id )
This removes nodes from the graph while other (dependents of the resource to destroy) are accessed.

First try:

  1. Collecting all resources to remove
  2. Remove collected resources

This leads to a NPE in org.deegree.workspace.SimpleSqlFeatureStoreTest#testDestroyInitializeSingle():

org.deegree.workspace.ResourceInitException: Unable to build resource FeatureStoreProvider:simplesql-ok: null

	at org.deegree.workspace.standard.DefaultWorkspace.init(DefaultWorkspace.java:398)
	at org.deegree.workspace.SimpleSqlFeatureStoreTest.testDestroyInitializeSingle(SimpleSqlFeatureStoreTest.java:158)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Caused by: java.lang.NullPointerException
	at org.deegree.feature.persistence.simplesql.DbFeatureUtils.determineFeatureType(DbFeatureUtils.java:110)
	at org.deegree.feature.persistence.simplesql.SimpleSQLFeatureStore.init(SimpleSQLFeatureStore.java:419)
	at org.deegree.workspace.standard.DefaultWorkspace.init(DefaultWorkspace.java:388)
	... 25 more

It seems that the the dependent JDBCConnection is not Initialised as expected.

lgoltz added a commit to lat-lon/deegree3 that referenced this issue Nov 3, 2020
@tfr42
Copy link
Member Author

tfr42 commented Nov 13, 2020

After further analysis of the problem the TMC has the motion to resolve the ConcurrentModificationException not by removing the code changes and let an entry remain on the graph
Instead we favor to synchronize the access to the internal state of class org.deegree.workspace.standard.DefaultWorkspace

@copierrj I'll prepare a PR that adds synchronized to the appropriate places

@tfr42
Copy link
Member Author

tfr42 commented Jan 29, 2021

This issue still needs further investigation and a more reliable solution. A PR is under way #1099.

@tfr42 tfr42 unpinned this issue Feb 12, 2021
@tfr42 tfr42 added the console deegree administration console label Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug error issue and bug (fix) console deegree administration console
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants