marklogic / marklogic/java-client-api
Non-Retryable requests when transactions are being used?
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 61
- Forks
- 74
- Merge moyen
- 2 j 53 min
- PR mergées (30 j)
- 8
Description
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)
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par OkHttpServices.sendRequestWithRetry et ses appelants, en particulier headImplExec et DocumentManagerImpl.exists, en utilisant la trace de la pile et l’argument de transaction comme points d’entrée. Examinez le comportement de nouvelle tentative existant et les tests relatifs aux défaillances transitoires du service. Le travail est terminé lorsque la décision de nouvelle tentative distingue les erreurs de communication du traitement de la transaction et couvre la requête exists transactionnelle avec des tests de régression.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- databases
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100