Community
Participate
Working Groups
Build Identifier: org.eclipse.equinox.p2.repository 2.0.1.R36x_v20100823 org.eclipse.equinox.internal.p2.repository.FileReader implementation might fail to cancel related FileReader$CancelHandler Jobs. When trying to update with improper proxy settings I end up with 950+ worker threads crashing the VM. All worker stacks look like: Thread.sleep(long) line: not available [native method] FileReader$CancelHandler.run(IProgressMonitor) line: 104 Worker.run() line: 54 It seems the problem is that after catching an Exception in HttpClientRetrieveFileTransfer.performConnect(IProgressMonitor) line: 1145 HttpClientRetrieveFileTransfer.openStreams() line: 710 the FileReader receives a IIncomingFileTransferReceiveDoneEvent via FileReader.handleTransferEvent(IFileTransferEvent) line: 186 HttpClientRetrieveFileTransfer(AbstractRetrieveFileTransfer).fireTransferReceiveDoneEvent() line: 365 HttpClientRetrieveFileTransfer.fireTransferReceiveDoneEvent() line: 1169 HttpClientRetrieveFileTransfer.checkAndHandleDone() line: 788 HttpClientRetrieveFileTransfer.openStreams() line: 716 and does not stop the related cancelJob during handling this event. (org.eclipse.equinox.p2.repository 2.0.1.R36x_v20100823) Reproducible: Always Steps to Reproduce: Probably requires special network settings. Access of external content requires usage of a proxy. Bypassing the proxy will lead to probematic Unknown host exceptions.
Please try again with 3.7 and reopen if the issue still exists. Thx
Created attachment 198734 [details] FileReader test project Attached simple JUnit Plug-in Test project. Running with Eclipse 3.7 it generates contained myLocalOutput.txt. None of the workers Thread[Worker-22,5,main] java.lang.Thread.sleep(Native Method) org.eclipse.equinox.internal.p2.transport.ecf.FileReader$CancelHandler.run(FileReader.java:111) org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) will ever finish.
See attached test project. org.eclipse.equinox.internal.p2.transport.ecf.FileReader will leak a worker thread in case an UnknownHostException occurs.
Henrik, could you please take a look?
(In reply to comment #4) > Henrik, could you please take a look? I am not setup to work on this. I did take a look at the code. And it seems that if these lines: // kill the cancelJob, if there is one if (cancelJob != null) { cancelJob.cancel(); cancelJob = null; } were to also be inserted into this method: public synchronized void handleTransferEvent(IFileTransferEvent event) } else if (event instanceof IIncomingFileTransferReceiveDoneEvent) { if (closeStreamWhenFinished) hardClose(theOutputStream); just before the if(closeStreamWhenFinished) check that would probably solve the problem as at that point (done), the cancel job has played out its role anyway. For a normal run the cancel job would have been cancelled by one of the other callbacks.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
This bug can still be seen. We currently experience it in several places, one of which is really annoying: When building an eclipse plugin via maven the hanging worker threads will cause the spawning maven process to run indefinitely. This means CI jobs on a machine without direct access to the internet and no configured proxy settings (which is intentionally left out) will never finish. The behavior can also be seen in other eclipse projects accessing update sites like the oomph setup mechanisms. At least there the stale processes are killed as soon as the tool is of the opinion that it's finished.
As a hint for other people having problems with this: The tycho maven plugin is trying to call a mirror list from the official eclipse repositories, even if you have configured specific sources for artifacts in the respective plugin project. If the host for that call cannot be resolved it will result in the stale threads described in this issue which will hang the maven process indefinitely. To get rid of this configure your environment to not ask for mirror lists as described here: https://wiki.eclipse.org/Tycho/FAQ#How_do_I_disable_P2_mirrors.3F Even though the above works around the issue, this bug should still be fixed.