连接Jira以获取问题时获取超时异常

时间:2017-04-05 10:21:33

标签: jira jira-rest-api connection-timeout

在特定JQL上获取Jira问题时,我在日志中遇到错误。我已经设置了一个调度程序,每30分钟运行一次JQL,以将检索到的问题同步到另一个工具。

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.TimeoutException
    at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:294)
    at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:267)
    at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:96)
    at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:69)
    at com.asurion.Autopilot.main(Autopilot.java:104)
Caused by: java.lang.RuntimeException: java.util.concurrent.TimeoutException
    at com.google.common.base.Throwables.propagate(Throwables.java:160)
    at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClient$3.apply(DefaultHttpClient.java:256)
    at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClient$3.apply(DefaultHttpClient.java:249)
    at com.atlassian.util.concurrent.Promises$Of$2.apply(Promises.java:276)
    at com.atlassian.util.concurrent.Promises$Of$2.apply(Promises.java:272)
    at com.atlassian.util.concurrent.Promises$2.onFailure(Promises.java:167)
    at com.google.common.util.concurrent.Futures$6.run(Futures.java:801)
    at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:262)
    at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:149)
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:134)
    at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:193)
    at com.google.common.util.concurrent.SettableFuture.setException(SettableFuture.java:68)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$1$3.run(SettableFuturePromiseHttpPromiseAsyncClient.java:73)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable$1.run(SettableFuturePromiseHttpPromiseAsyncClient.java:197)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient.runInContext(SettableFuturePromiseHttpPromiseAsyncClient.java:90)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable.run(SettableFuturePromiseHttpPromiseAsyncClient.java:192)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.TimeoutException
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$1.doCancelled(SettableFuturePromiseHttpPromiseAsyncClient.java:67)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalContextAwareFutureCallback$3.run(SettableFuturePromiseHttpPromiseAsyncClient.java:152)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient.runInContext(SettableFuturePromiseHttpPromiseAsyncClient.java:90)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalContextAwareFutureCallback.cancelled(SettableFuturePromiseHttpPromiseAsyncClient.java:147)
    at org.apache.http.impl.client.cache.CachingHttpAsyncClient$2.cancelled(CachingHttpAsyncClient.java:636)
    at org.apache.http.concurrent.BasicFuture.cancel(BasicFuture.java:150)
    at org.apache.http.impl.nio.client.DefaultResultCallback.cancelled(DefaultResultCallback.java:57)
    at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.cancel(DefaultAsyncRequestDirector.java:533)
    at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector$1.abortConnection(DefaultAsyncRequestDirector.java:222)
    at org.apache.http.client.methods.HttpRequestBase.cleanup(HttpRequestBase.java:137)
    at org.apache.http.client.methods.HttpRequestBase.abort(HttpRequestBase.java:151)
    at com.atlassian.httpclient.base.RequestKiller$RequestEntry.abort(RequestKiller.java:98)
    at com.atlassian.httpclient.base.RequestKiller.run(RequestKiller.java:56)
    ... 1 more

此错误经常发生但不是连续的。有时它会起作用,很多时候它都不会。

Jira Version: 7.1.4#71008
Jira REST Java Client Version: 2.0.0-m2
JIRA REST java-client-core Version: 2.0.0-m25

如果您需要更多详细信息,请与我们联系。

提前致谢。 问候, 图莎尔

2 个答案:

答案 0 :(得分:0)

看起来像您的请求超时,这取决于服务器负载。在同步过程中,您是否可以简化或拆分查询,设置更长的超时或在服务器上保留其他活动?

答案 1 :(得分:0)

Jira服务器存在一些问题。我们无法访问它,但几天后问题似乎消失了。不确定Jira方面发生了什么。