Community
Participate
Working Groups
in logical view, try to import several project at the same time sometime, the display is not refreshed and this exception is raised : java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:1091) at java.util.HashMap$KeyIterator.next(HashMap.java:1128) at org.eclipse.hyades.test.ui.internal.navigator.LogicalTestNavigatorContentProvider$ProxiesRequests.nodesChanged(LogicalTestNavigatorContentProvider.java:190) at org.eclipse.hyades.test.ui.internal.navigator.TestNavigator.nodesChanged(TestNavigator.java:1213) at org.eclipse.hyades.test.ui.internal.navigator.TestResourceChangeUpdater.ended(TestResourceChangeUpdater.java:115) at org.eclipse.hyades.ui.internal.provider.ResourceChangeUpdaterProvider.doProcessDelta(ResourceChangeUpdaterProvider.java:123) at org.eclipse.hyades.ui.internal.provider.ResourceChangeUpdaterProvider.resourceChanged(ResourceChangeUpdaterProvider.java:101) at org.eclipse.hyades.test.ui.internal.navigator.proxy.FileProxyNodeCache$ResourceChangeListener.resourceChanged(FileProxyNodeCache.java:717) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149) at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:327) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1181) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1984) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) problem occur because at the same time, the projectMap is updated on one side and on the other, we iterate on it
to be a bit more precise to reproduce it . first, go in logical view . then, import a very big project (as testnavigator.tests) . expand it . while the proxy are calculated, import another project reason : . all is happening inside LogicalTestNavigator class, inside ProxiesRequests subclass . when you import a project, it is added to the map "projectToRequestMap" . the listener on "nodesChanged" iterate on this map keyset. so, if this map is changed during this time, the "concurrentAccess" exception is raised fix : . make a synchronize block on the map time to copy the keySet list. . make the "nodesChanged" iterate on this copy updating estimated time, patch will come in a few
Created attachment 170534 [details] patch this patch protect the project map against multithread access : . map is now a SynchronizedMap (protect it for all adding/removing) . when we have to iterate on it (for refresh or dispose), we create a local copy in a small synchronized block and iterate on the copy
Paul, could you review it please ? many thanks in advance
test case added under CVS (will update wiki if patch is pushed under CVS)
Jerome, Is this a regression from previous releases or just a newly found problem? As you are aware, Paul is not available to review the patch at this time. Adding Joe to the CC list to review it. I'm tentatively targeting this to 4.7.1 unless this turns out to be a regression or a serious problem affecting many consumers.
This seems to be a very fringe use case (importing a project while a previously imported project is still being expanded in the Logical test navigator.) I agree with the 4.7.1 target.
seeing the source code, this bug exists since really long time (perhaps since logical view exists in test navigator) so, i agree on the 4.7.1 target (i made the patch because it was fast and to not forget it) updating worked hours
Requires adding /org.eclipse.hyades.test.ui.navigator.tests/manual/Test.UI.TestNavigator_bugzilla_315078.testsuite to /org.eclipse.hyades.test.ui.navigator.tests/manual/AllTests.testsuite and http://wiki.eclipse.org/TPTP_Test_Tools_Project_Tests#Manual.
Of interested but not formally requested by a consuming product. As such, a candidate defect for TPTP 4.7.0.1.
The attached patch reviewed with comments: -Update the copyright year to 2010. -Do we still need to synchronize on projectToRequestMap if we are using a synchronized map? If it's required, we should use a separate locking object.
(In reply to comment #10) > > -Do we still need to synchronize on projectToRequestMap if we are using a > synchronized map? If it's required, we should use a separate locking object. ya, synchronized map is automatically protected except for iterating part, that must be in synchronized block (synchronized on list itself, see : http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#synchronizedMap%28java.util.Map%29) Patch fixed (for copyright) and pushed on CVS head test suite added to "allTest" wiki updated closing
fix : update status to resolved insted of closed
verified in build TPTP-4.7.1-201008232100, closing