Closed iloveeclipse closed 2 years ago
I think in general any jobs running during shutdown encounter a state that is completely chaotic because some bundles are already stopped but the nothing expects to be working with stopped bundles:
There is not really a chaotic state at OSGi shutdown, each bundle is stopped in reverse order according to the startlevel but
@merks : see discussion on https://github.com/eclipse-platform/eclipse.platform.ui/issues/56. This issue is not important as is, but should help understand what's going wrong now, same as https://github.com/eclipse-platform/eclipse.platform.runtime/issues/50 . Something changed recently, so what we see now worries me.
so what we see now worries me
I confess I'm more worried about the things we don't see ;-)
E.g I think you see this probably now because we have such code in org.eclipse.core.internal.events.BuildManager.getWorkManager()
:
private WorkManager getWorkManager() {
try {
return workspace.getWorkManager();
} catch (CoreException e) {
//cannot happen
}
//avoid compile error
return null;
}
Just wanted to quote Murphy's Law here:
Anything that can go wrong will go wrong
(and also in the most worse way)
So probably you just don't see it (what not means this is the part where it happens!), and one better throws an AssertionError() than add a comment that it cannot happen
or remove the exception if it is never thrown.
But just as an example we assume it previously would triggered a CoreException
this code now might fail with a different exception (that is not hidden) just because the exception type is another one.
After fixing UILockListener via https://github.com/eclipse-platform/eclipse.platform.ui/issues/56 I see now two other errors appearing in the error log if I shutdown Eclipse with a refresh job running.
One of the errors is from resources plugin and has no stack trace. That must be added to understand the issue.
I plan to push a patch.