IDE Connector for IntelliJ blocks UI when connection attempt times out

Majid Burney October 9, 2013

Often when I try to log work against a JIRA issue after a long period of not having interacted with the connector, an attempted connection to JIRA will time out and the connector will block UI for the whole IDE until the exception is thrown (which seems to take 30-60 seconds).

I'm using IntelliJ IDEA 13EAP (latest release) and IDE connector version 3.0.12. I have experienced the same issue with IDEA 12 and earlier versions of the connector. I'm connecting to an OnDemand JIRA server.

My typical workflow is as follows:

  1. Start work on a JIRA issue from the Issues tool window. (This creates a task and change list.)
  2. Work on issue until ready to commit.
  3. On completion, log work by clicking the Log Work button in the IDEA toolbar.

When the issue manifests, I am never presented with the "Add Worklog" dialog after cicking the Log Work button. UI will hang until the following exception is thrown:

com.atlassian.connector.commons.jira.rss.JIRAException: xxxxx:[password xx chars]@https://xxxxx.atlassian.net

com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Operation timed out
	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.wrapWithJiraException(JiraRestSessionImpl.java:781)
	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.getIssue(JiraRestSessionImpl.java:583)
	at com.atlassian.connector.commons.jira.JiraRESTFacade2Impl.getIssue(JiraRESTFacade2Impl.java:246)
	at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.atlassian.connector.commons.jira.JIRAServerFacade2Impl$1.invoke(JIRAServerFacade2Impl.java:91)
	at com.sun.proxy.$Proxy37.getIssue(Unknown Source)
	at com.atlassian.connector.commons.jira.JIRAServerFacade2Impl.getIssue(JIRAServerFacade2Impl.java:228)
	at com.atlassian.theplugin.commons.jira.IntelliJJiraServerFacade.getIssue(IntelliJJiraServerFacade.java:318)
	at com.atlassian.theplugin.idea.action.issues.activetoolbar.ActiveIssueUtils.getJIRAIssue(ActiveIssueUtils.java:133)
	at com.atlassian.theplugin.idea.action.issues.activetoolbar.ActiveIssueUtils.getJIRAIssue(ActiveIssueUtils.java:120)
	at com.atlassian.theplugin.idea.action.issues.activetoolbar.ActiveIssueUtils.getJIRAIssue(ActiveIssueUtils.java:111)
	at com.atlassian.theplugin.idea.action.issues.activetoolbar.ActiveIssueLogWorkAction$1.run(ActiveIssueLogWorkAction.java:42)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
	at java.awt.EventQueue.access$400(EventQueue.java:82)
	at java.awt.EventQueue$2.run(EventQueue.java:676)
	at java.awt.EventQueue$2.run(EventQueue.java:674)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
	at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:696)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: com.atlassian.jira.rest.client.RestClientException: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Operation timed out
	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:81)
	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.getAndParse(AbstractJerseyRestClient.java:86)
	at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.getIssue(JerseyIssueRestClient.java:142)
	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl$23.call(JiraRestSessionImpl.java:585)
	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl$23.call(JiraRestSessionImpl.java:583)
	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.doCall(JiraRestSessionImpl.java:809)
	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.wrapWithJiraException(JiraRestSessionImpl.java:769)
	... 30 more
Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Operation timed out
	at com.sun.jersey.client.apache.DefaultApacheHttpMethodExecutor.executeMethod(DefaultApacheHttpMethodExecutor.java:213)
	at com.sun.jersey.client.apache.ApacheHttpClientHandler.handle(ApacheHttpClientHandler.java:175)
	at com.sun.jersey.api.client.Client.handle(Client.java:629)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:601)
	at com.sun.jersey.api.client.WebResource.get(WebResource.java:187)
	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$1.call(AbstractJerseyRestClient.java:90)
	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:60)
	... 36 more
Caused by: java.net.SocketException: Operation timed out
	at java.net.SocketInputStream.$$YJP$$socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead0(SocketInputStream.java)
	at java.net.SocketInputStream.read(SocketInputStream.java:129)
	at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:422)
	at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:460)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:863)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:820)
	at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
	at shadow.org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
	at shadow.org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
	at shadow.org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
	at shadow.org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
	at shadow.org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
	at shadow.org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
	at shadow.org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
	at shadow.org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
	at shadow.org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at shadow.org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at com.sun.jersey.client.apache.DefaultApacheHttpMethodExecutor.executeMethod(DefaultApacheHttpMethodExecutor.java:210)
	... 42 more

2 answers

1 accepted

0 votes
Answer accepted
Janusz Gorycki
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2013

Hi,

The JIRA link for postig connector bugs is exactly the one you found :)

I have created the issue for you: https://ecosystem.atlassian.net/browse/PL-2919

Please monitor the progress of fixing it there

Janusz

0 votes
Janusz Gorycki
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2013

Hi,

From the stack trace you posted, it looks like the JIRA server was unavailable when the connector tried to make a call to it - the SSL socket is failing to read data after the read timeout is reached. I am not sure why this would happen - could it be that the server was really out of reach at that time? Unfortnately, in order to display the subsequent parts of the "Stop Work" dialog sequence, the connector really needs to contact JIRA and retrieve some info from it, hence it does not display the dialog you are waiting for

Janusz

Majid Burney October 9, 2013

Hi Janusz, thanks for your reply.

Given the frequency with which I encounter the error (sometimes multiple times per day), and the fact that at those times I experience no other symptoms of connectivity loss, I don't think the server is actually out of reach. Retrying the dialog immediately after it times out always seems to succeed.

I'd like to clarify, though, that my problem isn't so much the inability of the dialog to display or the failed connection itself, but the 30-60 seconds during which all UI in IntelliJ is blocked. If the request happened in the background and didn't make my IDE unresponsive, I would happily work around the occassional failed connection. As it stands, any time this happens it's very disruptive and I'm forced to sit and wait until the exception is thrown, and a minute is a very long time to wait when you're in the middle of things.

I looked for a public bug tracker to submit this to, but wasn't able to find one — I only found what appears to be a dev-only JIRA project here: https://ecosystem.atlassian.net/browse/PL/. I see you're the lead on that project, would you be able to pass along my issue/feature request to prevent the request to JIRA from blocking IntelliJ UI?

If you need any more info from me, please let me know, and I'll gladly oblige. Thanks again.

Suggest an answer

Log in or Sign up to answer