Bitbucket code search intermittently fails with java.net.SocketTimeoutException error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

 

要約

Searching for code in Bitbucket intermittently times out with java.net.SocketTimeoutException error

環境

Bitbucket Server/Datacenter 6.10.2
Bundled or remote Elasticsearch instance

診断

During investigation the following entries are found in the application logs.

アプリケーション ログ
2020-10-20 12:10:18,120 DEBUG [http-nio-7990-exec-96] testuser *QJFEUBx730x9226605x5 qnl1o3 127.0.0.1,127.0.0.1 "POST /rest/search/latest/search HTTP/1.0" c.a.b.i.s.s.DefaultSearchService [77562] Search query: {
  "bool": {
    "must": {
      "bool": {
        "should": [
          {
            "match": {
              "content": {
                "query": "test",
                "operator": "and"
              }
            }
          },
          {
            "match": {
              "path": {
                "query": "test",
                "operator": "and"
... 
2020-10-20 12:10:23,140 ERROR [http-nio-7990-exec-96] testuser *QJFEUBx730x9226605x5 qnl1o3 127.0.0.1,127.0.0.1 "POST /rest/search/latest/search HTTP/1.0" c.a.b.i.s.search.rest.SearchResource Failed to process search request 'RestSearchRequest{entities={code=PagingInfo{start=0, limit=0}}, limits=Limits{primary=25, secondary=10}, query='project:~TEST_PROJ repo:testrepo test'}' - error: java.net.SocketTimeoutException
2020-10-20 12:10:23,141 DEBUG [http-nio-7990-exec-96] testuser *QJFEUBx730x9226605x5 qnl1o3 127.0.0.1,127.0.0.1 "POST /rest/search/latest/search HTTP/1.0" c.atlassian.bitbucket.search.timing Timing: Search request execution took 5.076 s [5076 ms] for query '~TEST_PROJ repo:testrepo test'
2020-10-20 12:10:23,144 ERROR [http-nio-7990-exec-96] testuser *QJFEUBx730x9226605x5 qnl1o3 127.0.0.1,127.0.0.1 "POST /rest/search/latest/search HTTP/1.0" c.a.s.i.r.e.DefaultUnhandledExceptionMapperHelper Unhandled exception while processing REST request: "POST /rest/search/latest/search HTTP/1.0"
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.net.SocketTimeoutException

原因

Due to a slowness to produce results from Elasticsearch, the request took longer than Bitbucket was expecting and it timed out the request. By default, Bitbucket sets a 5 seconds time out for waiting results from Elasticsearch.

ソリューション

Increase the code search timeout:

  1. Edit <BITBUCKET_HOME>/shared/bitbucket.properties adding the following parameter:

    plugin.search.search.http.socket.timeout=10

    (info) In this example we raised the timeout to 10 seconds. However this may vary accordingly to the size of your instance.

  2. Restart Bitbucket.


最終更新日 2021 年 4 月 13 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.