Skip to content

Commit 824b356

Browse files
author
Jörg Kubitz
committed
Do not suspend JobManager during startup by default
Because of possible deadlock when Javaeditor from JDT calls PDE calls OOMPH calls P2 to download new target platform waiting for a Job that is not executed because JobManager is suspendend eclipse-pde/eclipse.pde#1481 Was already suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=514090 Old behavior can be used by setting VM property -Dorg.eclipse.ui.suspendJobManagerDuringStart=true
1 parent f16064c commit 824b356

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ public class IDEApplication implements IApplication, IExecutableExtension {
133133
*/
134134
public static final String PLUGIN_ID = "org.eclipse.ui.ide.application"; //$NON-NLS-1$
135135

136+
/**
137+
* Suspending JobManager can be forced by specify VM property:
138+
* {@code -Dorg.eclipse.ui.suspendJobManagerDuringStart=true}
139+
*/
140+
static final boolean SUSPEND_JOBMANAGER_DURING_START = Boolean
141+
.getBoolean("org.eclipse.ui.suspendJobManagerDuringStart"); //$NON-NLS-1$
142+
136143
/**
137144
* Creates a new IDE application.
138145
*/
@@ -146,7 +153,9 @@ public Object start(IApplicationContext appContext) throws Exception {
146153
// is done to reduce resource contention during startup.
147154
// The job manager will be resumed by the
148155
// IDEWorkbenchAdvisor.postStartup method.
149-
Job.getJobManager().suspend();
156+
if (SUSPEND_JOBMANAGER_DURING_START) {
157+
Job.getJobManager().suspend();
158+
}
150159

151160
Display display = createDisplay();
152161
// processor must be created before we start event loop

bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchAdvisor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ public void postStartup() {
286286
} finally {
287287
// Resume the job manager to allow background jobs to run.
288288
// The job manager was suspended by the IDEApplication.start method.
289-
Job.getJobManager().resume();
289+
if (IDEApplication.SUSPEND_JOBMANAGER_DURING_START) {
290+
Job.getJobManager().resume();
291+
}
290292
}
291293
}
292294

0 commit comments

Comments
 (0)