Community
Participate
Working Groups
Occasionally (randomly?), the Photran test suite gives an error flushing the VPG database. So far, we have only seen this on Mac OS X 10.5 and 10.6 with the Helios release. CDT's Database class appears to catch and handle a similar problem (see the stack trace) by retrying the write, but the exception that's thrown is different from the one they catch. java.lang.Error: Unable to flush VPG database to disk at org.eclipse.rephraserengine.core.vpg.db.cdt.CDTDB.flush(CDTDB.java:134) at org.eclipse.rephraserengine.core.vpg.db.profiling.ProfilingDB.flush(ProfilingDB.java:121) at org.eclipse.rephraserengine.core.vpg.db.caching.CachingDB.flush(CachingDB.java:130) at org.eclipse.rephraserengine.core.vpg.VPG.computeEdgesAndAnnotations(VPG.java:205) at org.eclipse.rephraserengine.core.vpg.VPG.acquireTransientAST(VPG.java:147) at org.eclipse.rephraserengine.core.vpg.VPG.forceRecomputationOfEdgesAndAnnotations(VPG.java:292) at org.eclipse.rephraserengine.core.vpg.eclipse.EclipseVPG.indexIfNotUpToDate(EclipseVPG.java:406) at org.eclipse.rephraserengine.core.vpg.eclipse.EclipseVPG$WorkspaceSyncResourceVisitor.index(EclipseVPG.java:207) at org.eclipse.rephraserengine.core.vpg.eclipse.EclipseVPG.ensureVPGIsUpToDate(EclipseVPG.java:132) at org.eclipse.photran.internal.tests.PhotranRefactoringTestSuiteFromMarkers$IndividualRefactoringTestCase.importFiles(PhotranRefactoringTestSuiteFromMarkers.java:367) at org.eclipse.photran.internal.tests.PhotranRefactoringTestSuiteFromMarkers$IndividualRefactoringTestCase.importFiles(PhotranRefactoringTestSuiteFromMarkers.java:231) at org.eclipse.photran.internal.tests.PhotranRefactoringTestSuiteFromMarkers$IndividualRefactoringTestCase.test(PhotranRefactoringTestSuiteFromMarkers.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3586) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) Caused by: org.eclipse.core.runtime.CoreException: IOException at org.eclipse.rephraserengine.internal.db.org.eclipse.cdt.internal.core.pdom.db.Database.markFileIncomplete(Database.java:631) at org.eclipse.rephraserengine.internal.db.org.eclipse.cdt.internal.core.pdom.db.Database.flushAndUnlockChunks(Database.java:594) at org.eclipse.rephraserengine.internal.db.org.eclipse.cdt.internal.core.pdom.db.Database.giveUpExclusiveLock(Database.java:550) at org.eclipse.rephraserengine.internal.db.org.eclipse.cdt.internal.core.pdom.db.Database.flush(Database.java:562) at org.eclipse.rephraserengine.internal.core.vpg.db.cdt.InternalCDTDB.flush(InternalCDTDB.java:94) at org.eclipse.rephraserengine.core.vpg.db.cdt.CDTDB.flush(CDTDB.java:130) ... 57 more Caused by: java.nio.channels.ClosedChannelException at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:89) at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:642) at org.eclipse.rephraserengine.internal.db.org.eclipse.cdt.internal.core.pdom.db.Database.markFileIncomplete(Database.java:629) ... 62 more
Patch committed to ptp_4_0 and HEAD.
Matt's machine is still getting this exception, since it retries 20 times and then fails
Removed db.flush() from VPG#computeEdgesAndAnnotations. This seems to take care of the problem, since that's the only place where it's getting thrown from. It should also speed up indexing...