[java-bigquery] getQueryResults does not retry a SocketTimeoutException (read timeout)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 72/100
Direção de pesquisa
Comece em BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER em google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java, onde retryOn lista ConnectException, UnknownHostException e SocketException; SocketTimeoutException está ausente. Verifique se o handler desembrulha causas aninhadas antes de fazer a correspondência, depois adicione o caso read-timeout (ou seu equivalente) com as mesmas configurações de retry. Pronto se parece com um teste unitário no módulo bigquery que afirma que uma chamada getQueryResults que falha com uma SocketTimeoutException é tentada novamente em vez de lançada na primeira tentativa; o defeito de interrupção do gax é rastreado separadamente em #12860 / PR #14578.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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)
- Linguagem predominante
- Java
- Estrelas
- 2.1k
- Forks
- 1.2k
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 152
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de googleapis/google-cloud-java
-
gax-grpc: Surefire <test> pattern restricts the unit test run to a single testTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertapriority: p3 type: bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 94/100
googleapis/google-cloud-java#14572 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[java-firestore] CustomClassMapper.convertBigDecimal calls .abs() on Double, unintentionally flipping negative values to positiveTalvez já em andamento @wu-hui assumiu há 9 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
googleapis/google-cloud-java#14533 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Github CI failing when trying to install xmllintTalvez já em andamento @blakeli0 assumiu há 45 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
googleapis/google-cloud-java#14132 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
BigQuery: create() throws NullPointerException on a duplicate job id outside the US multi-region (java-bigquery#3034 not fixed by #3035)Talvez já em andamento @laughingman7743 assumiu há 59 dias. Abertapriority: p3 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
googleapis/google-cloud-java#14025 ·
Mantenedores costumam responder em até 1 dia
-
priority: p2 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
googleapis/google-cloud-java#13255 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de googleapis/google-cloud-java
Issues semelhantes
-
backend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
bcgov/nr-forest-client#2524 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Sinytra/ForgifiedFabricAPI#298 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
team:Lumberjack
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
OpenLiberty/open-liberty#35998 ·
Mantenedores costumam responder em até 1 dia