[java-bigquery] getQueryResults does not retry a SocketTimeoutException (read timeout)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia da BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER in google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java, dove retryOn elenca ConnectException, UnknownHostException e SocketException; SocketTimeoutException è assente. Verifica se il gestore scompatta le cause annidate prima della corrispondenza, poi aggiungi il caso read-timeout (o il suo equivalente) con le stesse impostazioni di retry. Fatto sembra un unit test nel modulo bigquery che afferma che una chiamata getQueryResults che fallisce con una SocketTimeoutException viene ritentata invece che lanciata al primo tentativo; il difetto di interrupt di gax è tracciato separatamente in #12860 / PR #14578.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- Java
- Stelle
- 2.1k
- Fork
- 1.2k
- Merge medio
- 2g 16h
- PR unite (30g)
- 126
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di googleapis/google-cloud-java
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
googleapis/google-cloud-java#14636 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
googleapis/google-cloud-java#14635 ·
I maintainer di solito rispondono entro 1 giorno
-
[java-firestore] UserDataConverter throws IndexOutOfBoundsException on an empty __binary__ valueAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
googleapis/google-cloud-java#14634 ·
I maintainer di solito rispondono entro 1 giorno
-
[java-firestore] CustomClassMapper.convertBigDecimal calls .abs() on Double, unintentionally flipping negative values to positiveForse già presa @wu-hui l’ha presa 13 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
googleapis/google-cloud-java#14533 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Github CI failing when trying to install xmllintForse già presa @blakeli0 l’ha presa 48 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
googleapis/google-cloud-java#14132 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di googleapis/google-cloud-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
quelea-projection/Quelea#711 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ShaftHQ/SHAFT_ENGINE#6909 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
mudler/parakeet.cpp#99 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Re-subscribing the Mono returned by listTools/listResources/listResourceTemplates/listPrompts/listRoots duplicates the resultsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelcontextprotocol/java-sdk#1174 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
建议在文档中补充逻辑删除与唯一索引冲突的处理方案Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
baomidou/mybatis-plus#7185 ·