[java-bigquery] getQueryResults does not retry a SocketTimeoutException (read timeout)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Comienza en BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER en google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java, donde retryOn enumera ConnectException, UnknownHostException y SocketException; SocketTimeoutException está ausente. Comprueba si el handler desenvuelve causas anidadas antes de hacer coincidir, luego añade el caso de read-timeout (o su equivalente) con la misma configuración de reintentos. Hecho se ve como una prueba unitaria en el módulo bigquery que afirma que una llamada getQueryResults que falla con una SocketTimeoutException se reintenta en lugar de lanzarse en el primer intento; el defecto de interrupción de gax se rastrea por separado en #12860 / PR #14578.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- Java
- Estrellas
- 2.1k
- Forks
- 1.2k
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 147
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/google-cloud-java
-
gax-grpc: Surefire <test> pattern restricts the unit test run to a single testPosiblemente ocupada @macastelaz la tomó hace 4 días. Abiertopriority: p3 type: bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
googleapis/google-cloud-java#14572 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[java-firestore] CustomClassMapper.convertBigDecimal calls .abs() on Double, unintentionally flipping negative values to positivePosiblemente ocupada @wu-hui la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
googleapis/google-cloud-java#14533 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Github CI failing when trying to install xmllintPosiblemente ocupada @blakeli0 la tomó hace 42 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
googleapis/google-cloud-java#14132 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
BigQuery: create() throws NullPointerException on a duplicate job id outside the US multi-region (java-bigquery#3034 not fixed by #3035)Posiblemente ocupada @laughingman7743 la tomó hace 57 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleapis/google-cloud-java#14025 ·
Los mantenedores suelen responder en 1 día
-
priority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleapis/google-cloud-java#13255 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleapis/google-cloud-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Make branch and label autocomplete matching locale-independentPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
jenkinsci/gitlab-plugin#1950 ·
-
It's not necessary to copy the memory block in the readWrite() of org.h2.store.fs.mem.FileMemDataAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
h2database/h2database#4435 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
micronaut-projects/micronaut-core#13717 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ADORSYS-GIS/token-status-link#145 ·
Los mantenedores suelen responder en 3 días