PostgreSQL へのコネクションの問題によって Jira でスレッドがスタックする

お困りですか?

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

コミュニティに質問

Setting socketTimeoutException is no longer advised as it may cause problems with longer database queries that Jira may perform, for example during upgrade tasks (please see:   JRASERVER-74314 - Getting issue details... STATUS ) This property will no longer be added to database configuration since Jira 9.4 and will be ignored for existing configurations.   

特定のネットワーク セットアップにおいて、PostgreSQL データベースへのコネクションの問題によって Jira スレッドがスタックする場合があります。これは通常は、データベースからのレスポンスが Jira に渡されず、Jira がアクションの完了を待ち続ける場合に発生します。修正策は、指定した時間の経過後に各コネクションを終了するプロパティを手動で追加することです。

コンテキスト

We’ve encountered this problem only with the PostgreSQL database and specific network setup, where you have proxies between Jira and the database. The reason for it is that data packets sent from Jira to the database are lost, and the response is never returned by the proxy, which results in stuck threads.
Usually, with problems with the database, the connection would be terminated before that happens, but in these conditions it seems like the database is still performing the action Jira is waiting for.
See related issue (fixed in 8.16)

ソリューション

この問題を解決するには、次の手順を実行します。

  1. PostgreSQL の JDBC ドライバを 42.2.19 以降にアップグレードします。このドライバは、以降の手順で追加するプロパティをより良く処理できます。

    1. https://jdbc.postgresql.org/ からドライバをダウンロードします。
    2. Jira を停止します。
    3. 新しいドライバを <jira-install>/lib にコピーします。
    4. 古いものを取り除きます。
    5. Jira の起動
  2. Edit the dbconfig.xml file, and add the following properties between the <jdbc-datasource> or  <jdbc-resource> tags, see  example below:( This file (located at the root of your JIRA home directory) defines all details for JIRA's database connection. This file is typically created by running the JIRA setup wizard on new installations of JIRA, or by configuring a database connection using the JIRA configuration tool.)

  3. <jira-database-config>
      ...
      <jdbc-datasource>
        ...
        <connection-properties>tcpKeepAlive=true;socketTimeout=240</connection-properties>
      </jdbc-datasource>
    </jira-database-config>


    • tcpKeepAlive:コネクションが引き続き実行されているかどうかを確認します。

    • socketTimeout:指定された時間 (秒) の経過後にコネクションを終了します。4 分は保守的な値であり、長時間かかる SQL クエリを実行することが多い場合は値を増やすことができます。

  4. Jira を再起動します。

PostgreSQL の JDBC ドライバのバージョン

ドライバのバグにより、socketTimeout コネクション プロパティが適切に適用されていませんでした。バージョン 42.2.15 (2020-08-14) には次のバグ修正が含まれます。

さらに、42.2.19 よりも前の JDBC バージョンでは、SocketTimeoutException が無視されるためにタイムアウトが期待どおり動作しないバグが存在します。バージョン 42.2.19 (2021-02-18) には次のバグ修正が含まれます。

(warning) socketTimeout コネクション プロパティが期待どおりに動作するよう、バージョン 42.2.19 以降を利用するようにしてください。 

Last modified on Mar 21, 2024

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

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