marklogic / marklogic/java-client-api

Non-Retryable requests when transactions are being used?

Abierto
#1,886 7 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Bug
Lenguaje dominante
Java
Estrellas
61
Forks
74
Merge medio
2 d 53 min
PR fusionados (30 d)
8

Descripción

We run our integration tests in gitlab in a dockerized environment, and since we started to use MarkLogic server transactions more we noticed our tests behaving increasingly flaky. We suspect the dockerized environment to induce some connection and availability issues. Here is a stacktrace of one of the issues:

com.marklogic.client.FailedRetryException: Service unavailable and maximum retry period elapsed: 0 seconds after 0 retries
	at com.marklogic.client.impl.OkHttpServices.sendRequestWithRetry(OkHttpServices.java:576)
	at com.marklogic.client.impl.OkHttpServices.headImplExec(OkHttpServices.java:1054)
	at com.marklogic.client.impl.OkHttpServices.headImpl(OkHttpServices.java:1016)
	at com.marklogic.client.impl.OkHttpServices.head(OkHttpServices.java:972)
	at com.marklogic.client.impl.DocumentManagerImpl.exists(DocumentManagerImpl.java:145)

The code leading into this trace is supposed to check, whether a document exists and looks like this:

final DocumentDescriptor documentDescriptor = manager.exists(docUri.toString(), transaction);

The transaction is non-null in the above statement. And as it turns out the OkHttpServices in line 1054:

return sendRequestWithRetry(requestBldr, (transaction == null), doHeadFunction, null);

renders a request using a transaction being "not retryable".

In a distributed system communication errors can happen, regardless of whether a transaction is being used or not. There should be a destinction being made depending on the type of error, whether it makes sense to repeat a request. The existence of a transaction should not make a difference here.

(We are currently using the marklogic-java-client in version 8.0.0 and the Markogic Server in 11.3.1)

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con OkHttpServices.sendRequestWithRetry y sus invocadores, especialmente headImplExec y DocumentManagerImpl.exists, utilizando el stack trace y el argumento de transacción como puntos de entrada. Revisa el comportamiento de reintento existente y las pruebas para fallos transitorios del servicio. Se considera completado cuando la decisión de reintento distingue entre errores de comunicación y el procesamiento de la transacción, y cubre la solicitud transaccional exists con pruebas de regresión.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
databases
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.