-
Notifications
You must be signed in to change notification settings - Fork 74
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)