[java-bigquery] getQueryResults does not retry a SocketTimeoutException (read timeout)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER(google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java)から始めます。ここで retryOn は ConnectException、UnknownHostException、SocketException を列挙しており、SocketTimeoutException は含まれていません。ハンドラがマッチングの前にネストされた原因をアンラップするか確認し、次に同じ retry settings で read-timeout ケース(または同等のもの)を追加します。完了とは、bigquery モジュール内の unit test で、SocketTimeoutException で失敗する getQueryResults 呼び出しが最初の試行でスローされるのではなく再試行されることをアサートするものです。gax interrupt defect は #12860 / PR #14578 で別途追跡されています。
索引モデルが issue の本文から書いたものです。
説明
Issue Details
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER retries ConnectException, UnknownHostException and SocketException, but not SocketTimeoutException. So when one getQueryResults call inside Job.waitFor takes longer than the HTTP read timeout, the query fails at once with BigQueryException: Read timed out, after one attempt. A read timeout on this idempotent poll is as transient as a SocketException, and the job itself is still running.
Job.waitFor calls getQueryResults with no timeoutMs, so BigQuery holds each call for up to 10 s. java-bigquery sets the HTTP read timeout to 60,000 ms by default. A poll that gets no answer within 60 s, most likely a connection that died, fails the whole query, although the job is still running and the next poll would succeed. A longer read timeout does not help a dead connection. Only a retry does.
Edited 2026-10-04: an earlier version said the default read timeout is 20,000 ms. It is 60,000 ms.
Today a second defect hides this one: gax turns the SocketTimeoutException into a thread interrupt, so the caller sees BigQueryException: java.lang.InterruptedException instead (#12860, PR #14578). With that gax fix applied, the same stall fails with Read timed out after one attempt. That remaining failure is this issue.
Expected: getQueryResults (and other idempotent reads) retries a SocketTimeoutException under the same retry settings as a SocketException.
Environment
- OS Type and Version: macOS 26.6.2 (arm64)
- Java Version and JDK Vendor: OpenJDK 25 (2025-09-16 LTS)
- Deployment: a JVM server that calls BigQuery through
com.google.cloud:google-cloud-bigquery, with Application Default Credentials.
Dependencies
- Client library:
com.google.cloud:google-cloud-bigquery2.54.1 (not using libraries-bom). The handler is the same onmaintoday. - Gax:
gaxandgax-httpjson2.84.0 - Auth:
google-auth-library-oauth2-http1.37.1 to 1.51.0 - Google-Http-Java-Client: 1.47.1 to 2.2.0
Reproducer
- Build a
BigQueryclient with a short HTTP read timeout, for example 2 s, throughHttpTransportOptions. - Run a query, and call
job.waitFor()while BigQuery holdsgetQueryResults(any query that takes more than 2 s). - With a gax that has the #14578 fix,
waitForthrowsBigQueryException: Read timed out(causejava.net.SocketTimeoutException) after one attempt. With current gax, it throwsBigQueryException: java.lang.InterruptedException.
The same wait with the default timeout succeeds. The handler in question is in google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java:
.abortOn(RuntimeException.class)
.retryOn(java.net.ConnectException.class)
.retryOn(java.net.UnknownHostException.class)
.retryOn(java.net.SocketException.class)
- 主要言語
- Java
- スター
- 2.1k
- フォーク
- 1.2k
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 147
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/google-cloud-java のほかの issue
-
gax-grpc: Surefire <test> pattern restricts the unit test run to a single test対応中かも @macastelaz が 4 日前に担当しました。 オープンpriority: p3 type: bug
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
googleapis/google-cloud-java#14572 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[java-firestore] CustomClassMapper.convertBigDecimal calls .abs() on Double, unintentionally flipping negative values to positive対応中かも @wu-hui が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
googleapis/google-cloud-java#14533 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Github CI failing when trying to install xmllint対応中かも @blakeli0 が 42 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
googleapis/google-cloud-java#14132 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
BigQuery: create() throws NullPointerException on a duplicate job id outside the US multi-region (java-bigquery#3034 not fixed by #3035)対応中かも @laughingman7743 が 57 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/google-cloud-java#14025 ·
メンテナーはふだん 1 日以内に返信
-
priority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/google-cloud-java#13255 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
googleapis/google-cloud-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
Make branch and label autocomplete matching locale-independent対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
jenkinsci/gitlab-plugin#1950 ·
-
It's not necessary to copy the memory block in the readWrite() of org.h2.store.fs.mem.FileMemDataオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
h2database/h2database#4435 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
micronaut-projects/micronaut-core#13717 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ADORSYS-GIS/token-status-link#145 ·
メンテナーはふだん 3 日以内に返信