marklogic / marklogic/java-client-api

Non-Retryable requests when transactions are being used?

Aperta
#1,886 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Bug
Lingua principale
Java
Stelle
61
Fork
74
Merge medio
2g 53m
PR unite (30g)
8

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da OkHttpServices.sendRequestWithRetry e dai suoi chiamanti, in particolare headImplExec e DocumentManagerImpl.exists, usando lo stack trace e l'argomento della transazione come punti di ingresso. Esamina il comportamento di retry esistente e i test per i guasti transitori del servizio. Il lavoro è completato quando la decisione di retry distingue gli errori di comunicazione dalla gestione della transazione e copre la richiesta exists transazionale con test di regressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.