Community
Participate
Working Groups
Option "eclipse.p2.mirrors=false" disables mirrors, but p2 checks mirrors anyway in some cases (I don't know which exactly). This resulted in a very slow build for me (Bug 323977), that I could only fix by hacking org.eclipse.equinox.internal.p2.repository.FileReader to not connect to mirrors. It would be useful to have an option that disables all connections to mirrors, even if that can result in a failed install.
The mirror selection code in p2 should be completely disabled if you set the eclipse.p2.mirrors=false System property. (the code is in an "if" stmt) Are you able to get a dump of the System properties for a build where the bits are being retrieved from the mirrors when this property is set? When you made the code changes in bug 324983 comment 9, what was the console output? Which non-eclipse.org sites was it trying to access? Thomas, are you familiar with Buckminster and how the properties should be set in order to be passed along to p2? Have you seen any problems in this area recently?
Created attachment 179385 [details] list of contacted mirrors Here is a build log with information about which URLs p2 tries to access: https://hudson.eclipse.org/hudson/job/modisco-nightly/211/consoleFull Since the log is very verbose, I am attaching the list of contacted mirrors.
I add code to print the properties and system environment in org.eclipse.equinox.internal.p2.repository.FileReader.sendRetrieveRequest, and eclipse.p2.mirrors is here. Here is what I get: ***** SYSTEM PROPERTIES ***** eclipse.download = 'file:/home/data/httpd/download.eclipse.org' eclipse.p2.mirrors = 'false' ***** SYSTEM ENV ***** ANT_OPTS = '-Dhttp.proxyHost=proxy.eclipse.org -Dhttp.proxyPort=9898 -Dhttps.proxyHost=proxy.eclipse.org -Dhttps.proxyPort=9898 -Dhttp.noProxyHosts="*.eclipse.org" -Dhttps.noProxyHosts="*.eclipse.org"' WINDOWMANAGER = '/usr/bin/gnome' JAVA_HOME = '/shared/common/sun-jdk1.6.0_21_x64' LESSCLOSE = 'lessclose.sh %s %s' ENV = '/etc/bash.bashrc' SSH_CLIENT = '172.30.206.140 35548 22' HOSTTYPE = 'x86_64' HUDSON_URL = 'https://hudson.eclipse.org/hudson/' MAIL = '/var/mail/hudsonbuild' JOB_URL = 'https://hudson.eclipse.org/hudson/job/modisco-nightly/' https_proxy = 'http://proxy.eclipse.org:9898' HOSTNAME = 'build' HOST = 'hudson-slave1' PWD = '/opt/users/hudsonbuild/workspace/modisco-nightly' XCURSOR_THEME = 'DMZ' VERSION = '0.9.0' LS_OPTIONS = '-N --color=none -T 0' CVS_RSH = 'ssh' G_FILENAME_ENCODING = '@locale,UTF-8,ISO-8859-15,CP1252' MACHTYPE = 'x86_64-suse-linux' G_BROKEN_FILENAMES = '1' NODE_NAME = 'hudson-slave1' NLSPATH = '/usr/dt/lib/nls/msg/%L/%N.cat' BUILD_NUMBER = '215' FRESH_WORKSPACE = 'true' EXECUTOR_NUMBER = '7' INPUTRC = '/opt/users/hudsonbuild/.inputrc' HISTSIZE = '1000' XKEYSYMDB = '/usr/share/X11/XKeysymDB' XDG_CONFIG_DIRS = '/etc/xdg' PATH = '/shared/common/sun-jdk1.6.0_21_x64/bin:/opt/users/hudsonbuild/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin' XNLSPATH = '/usr/share/X11/nls' BUILD_TYPE = 'N' LESS_ADVANCED_PREPROCESSOR = 'no' http_proxy = 'http://proxy.eclipse.org:9898' LESS = '-M -I' PAGER = 'less' ANT_ARGS = '-Dhttp.proxyHost=proxy.eclipse.org -Dhttp.proxyPort=9898 -Dhttps.proxyHost=proxy.eclipse.org -Dhttps.proxyPort=9898 -Dhttp.noProxyHosts="*.eclipse.org" -Dhttps.noProxyHosts="*.eclipse.org"' PYTHONSTARTUP = '/etc/pythonstart' SVN_REVISION = '3189' no_proxy = 'localhost, 127.0.0.1, eclipse.org, 172.30.206.0' HUDSON_HOME = '/opt/users/hudsonbuild/.hudson' INFOPATH = '/usr/local/info:/usr/share/info:/usr/info' OSTYPE = 'linux' FRESH_TARGET_PLATFORM = 'true' PROJRELENGROOT = 'svn://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.modisco/releng/trunk' SIGN_UPDATE_SITE = 'false' LESSKEY = '/etc/lesskey.bin' INFODIR = '/usr/local/info:/usr/share/info:/usr/info' SHLVL = '3' XFILESEARCHPATH = '/usr/dt/app-defaults/%L/Dt' MANPATH = '/usr/local/man:/usr/local/share/man:/usr/share/man' MINICOM = '-c on' CPU = 'x86_64' COLORTERM = '1' SKIP_LONG_JUNIT_TESTS = 'false' NNTPSERVER = 'news' XDG_DATA_DIRS = '/usr/share:/etc/opt/kde3/share:/opt/kde3/share' JAVA_ARGS = '-Dhttp.proxyHost=proxy.eclipse.org -Dhttp.proxyPort=9898 -Dhttps.proxyHost=proxy.eclipse.org -Dhttps.proxyPort=9898 -Dhttp.noProxyHosts="*.eclipse.org" -Dhttps.noProxyHosts="*.eclipse.org"' BUILD_ID = '2010-09-22_11-29-35' LOGNAME = 'hudsonbuild' BUILD_TAG = 'hudson-modisco-nightly-215' BUILD_URL = 'https://hudson.eclipse.org/hudson/job/modisco-nightly/215/' PROFILEREAD = 'true' _ = '/shared/common/sun-jdk1.6.0_21_x64/bin/java' LD_LIBRARY_PATH = '/opt/public/common/sun-jdk1.6.0_21_x64/jre/lib/amd64/server:/opt/public/common/sun-jdk1.6.0_21_x64/jre/lib/amd64:/opt/public/common/sun-jdk1.6.0_21_x64/jre/../lib/amd64' SSH_CONNECTION = '172.30.206.140 35548 172.30.206.141 22' SHELL = '/bin/bash' MORE = '-sl' WORKSPACE = '/opt/users/hudsonbuild/workspace/modisco-nightly' JVM_OPTS = '-Dhttp.proxyHost=proxy.eclipse.org -Dhttp.proxyPort=9898 -Dhttps.proxyHost=proxy.eclipse.org -Dhttps.proxyPort=9898 -Dhttp.noProxyHosts="*.eclipse.org" -Dhttps.noProxyHosts="*.eclipse.org"' DISPLAY = ':10' USER = 'hudsonbuild' QT_HOME_DIR = '/usr/share/desktop-data' JOB_NAME = 'modisco-nightly' HOME = '/opt/users/hudsonbuild' LESSOPEN = 'lessopen.sh %s' HUDSON_COOKIE = '1bd243f2-35af-4f56-8e0f-d92166f7adf4' CSHEDIT = 'emacs' LANG = 'en_US.UTF-8'
Are the single quotes around 'false' something that you added or actually part of the value of the property?
(In reply to comment #4) > Are the single quotes around 'false' something that you added or actually part > of the value of the property? I added it in the print statement; it's not part of the value.
(In reply to comment #1) > Thomas, are you familiar with Buckminster and how the properties should be set > in order to be passed along to p2? Buckminster will just use the p2 api's to access the repositories and it doesn't interfere with what's been passed in the system properties. This is also shown in the printout from comment #3 where the eclipse.p2.mirrors = 'false' is present. > Have you seen any problems in this area recently? I have seen that resolutions often take very long to complete, not just from Buckminster but also when resolving target platforms or doing normal installs into my IDE. I haven't had time to investigate deeper so I'm afraid I can't be of much help.
I haven't been able to reproduce this yet locally by doing regular installs. If you don't mind instrumenting your build, can you put some debug information in: SimpleArtifactRepository#getMirror This is the code where we decide if we want to use a mirror or not. I'm not sure if putting a full stack trace in the FileReader code would help or just dump out more information than we can handle. Of course the next step would be to set up the build for remote debugging or enable us to run it locally here so we can connect.
I have added debug print statements in SimpleArtifactRepository#getMirror. I am getting: MIRRORS_ENABLED = true. MIRRORS_ENABLED is defined as: public static final boolean MIRRORS_ENABLED = !"false".equals(Activator.getContext().getProperty("eclipse.p2.mirrors")); //$NON-NLS-1$//$NON-NLS-2$ So, I added other print statements in SimpleArtifactRepository#getMirror: Activator.getContext().getProperty("eclipse.p2.mirrors") returns null. Whereas System.getProperty("eclipse.p2.mirrors") returns "false". So, it looks like BundleContext#getProperty is not working as expected.
This might be caused by late setting of the system property. If you pass it as an option to the Buckminster command, i.e. buckminster <some command> -Dxxx=yyy or buckminster -P<some property file> ... then Buckminster will see to that it ends up in the system properties. That however, might be too late. I don't know when the p2 bundle is activated and if it's activated before the Buckminster command bundle is activated, then this would probably happen. Can you try and pass the option as a jvm option instead? I.e. buckminster xxxx -vmargs -Dxxx=yyy
It works! Thank you Thomas. I get: MIRRORS_ENABLED = false System.getProperty("eclipse.p2.mirrors") = false Activator.getContext().getProperty("eclipse.p2.mirrors") = false To avoid this problem in the future, maybe Buckminster could emit a warning when properties are passed in this way, and explain the better way?
I would be interested if there's a way to influence the OSGi framework after it's initialized. Regardless of that, I still think this bug is very relevant so I'm reopening it. There should be some other way to tell p2 to avoid mirrors then to just set a property.
(In reply to comment #11) > There should be some other way to tell p2 to avoid mirrors > then to just set a property. At least, it shouldn't be a constant but changeable at runtime. FWIW, I would also like the ability to "override" the list of mirrors at runtime or provide alternate mirrors. Currently, I can mirror p2 repos inside my network. However, I can't use a single shared p2 target platform for developers and build systems because I manually have to switch the repos. It would be great if I can "annotate" repos at runtime with mirrors to look at with a higher priority.
Nicolas, thank you for the investigation. I have removed this as a blocker for bug 324983. I have updated the bug report title to better reflect what this bug is asking for now. (see comment 12) Gunnar, I have opened bug 326039 to address being able to pass your own list of mirrors.
*** This bug has been marked as a duplicate of bug 266199 ***