Community
Participate
Working Groups
Build Identifier: I would be nice if the cancel will done immediately. Maybe this is not possible if a "external" (none java) library is called but I think this is all pure java :) Reproducible: Didn't try Steps to Reproduce: 1. "new query" 2. ... search options update starts ... 3. click "cancel" 4. but then the update is still running ... (a long time)
Created attachment 154754 [details] screenshot of query page If I clicked "cancel" the query page is in " deathlock" state. I can't close the dialog, because the update is still running.
The problem is the stream is exhausted upon cancel instead of closing the connection right away. Rob, we'll need a utility method to handle that case as this is a general problem that affects all connectors. Stack trace for Bugzilla: "ModalContext" prio=10 tid=0x6f8fdc00 nid=0x7199 runnable [0x6f4ad000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) at java.io.BufferedInputStream.read(BufferedInputStream.java:317) - locked <0xad18b9a8> (a java.io.BufferedInputStream) at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:170) at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:184) at org.apache.commons.httpclient.ChunkedInputStream.exhaustInputStream(ChunkedInputStream.java:369) at org.apache.commons.httpclient.ContentLengthInputStream.close(ContentLengthInputStream.java:118) at java.io.FilterInputStream.close(FilterInputStream.java:155) at org.apache.commons.httpclient.AutoCloseInputStream.notifyWatcher(AutoCloseInputStream.java:194) at org.apache.commons.httpclient.AutoCloseInputStream.close(AutoCloseInputStream.java:158) at org.apache.commons.httpclient.HttpMethodBase.releaseConnection(HttpMethodBase.java:1181) at org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient.getRepositoryConfiguration(BugzillaClient.java:643) at org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector.getRepositoryConfiguration(BugzillaRepositoryConnector.java:722) - locked <0xb0beb340> (a java.util.HashMap) at org.eclipse.mylyn.internal.bugzilla.ui.search.BugzillaSearchPage$11.run(BugzillaSearchPage.java:1884) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Created attachment 158412 [details] proposed fix
Created attachment 158413 [details] mylyn/context/zip
Rob, Shawn, please take a look at the proposed change and let me know what you think. We would need to change every call to method.releaseConnection() to go through WebUtil and pass the progress monitor along and remove calls to stream.close() which I missed in the patch.
That looks good to me.
Created attachment 161051 [details] improved patch
Need to postpone applying patch until bug 304755 is resolved since org.eclipse.mylyn.commons.net has a fixed version and this change adds API. Remaining work: - check remaining invocations of method.releaseConnection() - check invocations of WebUtil.getResponseBodyAsStream() or re-implement close() in returned stream
Also need to consider the case where a connection release is already in progress when a request is cancelled: "Worker-24" prio=5 tid=0x455d4800 nid=0xb15d8000 waiting for monitor entry [0xb15d7000] java.lang.Thread.State: BLOCKED (on object monitor) at java.io.BufferedInputStream.read(BufferedInputStream.java:308) - waiting to lock <0x27a8e538> (a java.io.BufferedInputStream) at org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:182) at org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:196) at org.apache.commons.httpclient.ChunkedInputStream.exhaustInputStream(ChunkedInputStream.java:369) at org.apache.commons.httpclient.ChunkedInputStream.close(ChunkedInputStream.java:346) at java.io.FilterInputStream.close(FilterInputStream.java:155) at org.apache.commons.httpclient.AutoCloseInputStream.notifyWatcher(AutoCloseInputStream.java:194) at org.apache.commons.httpclient.AutoCloseInputStream.close(AutoCloseInputStream.java:158) at org.apache.commons.httpclient.HttpMethodBase.releaseConnection(HttpMethodBase.java:1181) "Worker-24" prio=5 tid=0x455d4800 nid=0xb15d8000 waiting for monitor entry [0xb15d7000] java.lang.Thread.State: BLOCKED (on object monitor) at java.io.BufferedInputStream.read(BufferedInputStream.java:308) - waiting to lock <0x27a8e538> (a java.io.BufferedInputStream) at org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:182) at org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:196) at org.apache.commons.httpclient.ChunkedInputStream.exhaustInputStream(ChunkedInputStream.java:369) at org.apache.commons.httpclient.ChunkedInputStream.close(ChunkedInputStream.java:346) at java.io.FilterInputStream.close(FilterInputStream.java:155) at org.apache.commons.httpclient.AutoCloseInputStream.notifyWatcher(AutoCloseInputStream.java:194) at org.apache.commons.httpclient.AutoCloseInputStream.close(AutoCloseInputStream.java:158) at org.apache.commons.httpclient.HttpMethodBase.releaseConnection(HttpMethodBase.java:1181)
I have committed the patch.