Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2011-02-11 20:24:10 +0000
committerDJ Houghton2011-02-11 20:24:10 +0000
commite5016c27d78dd980cb648d47c9dde7c05617e2a2 (patch)
tree74ad4fbbd38ea352ba5c889c9d6176e6db46f382
parentfa0e59f385d5c0c5b07a896a76e931d9e2bcb3a8 (diff)
downloadrt.equinox.p2-e5016c27d78dd980cb648d47c9dde7c05617e2a2.tar.gz
rt.equinox.p2-e5016c27d78dd980cb648d47c9dde7c05617e2a2.tar.xz
rt.equinox.p2-e5016c27d78dd980cb648d47c9dde7c05617e2a2.zip
Bug 336968 - Provide ability to adjust default projector timeout valueR34x_v20110211
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
index 2ff989075..3f24191ca 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others. All rights reserved. This
+ * Copyright (c) 2007, 2011 IBM Corporation and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@@ -691,7 +691,24 @@ public class Projector implements IProjector {
return result;
boolean delete = true;
IPBSolver solver = SolverFactory.newEclipseP2();
- solver.setTimeoutOnConflicts(1000);
+
+ int timeout = 1000;
+ String timeoutString = null;
+ try {
+ // allow the user to specify a longer timeout.
+ // only set the value if it is a positive integer larger than the default.
+ // see https://bugs.eclipse.org/336968
+ timeoutString = DirectorActivator.context.getProperty("eclipse.p2.projector.timeout"); //$NON-NLS-1$
+ if (timeoutString != null)
+ timeout = Math.max(timeout, Integer.parseInt(timeoutString));
+ } catch (Exception e) {
+ // intentionally catch all errors (npe, number format, etc)
+ // print out to syserr and fall through
+ System.err.println("Ignoring user-specified 'eclipse.p2.projector.timeout' value of: " + timeoutString); //$NON-NLS-1$
+ e.printStackTrace();
+ }
+ solver.setTimeoutOnConflicts(timeout);
+
OPBEclipseReader2007 reader = new OPBEclipseReader2007(solver);
// CNF filename is given on the command line
long start = System.currentTimeMillis();

Back to the top