diff options
2 files changed, 5 insertions, 4 deletions
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/local/LocalDocumentAccess.java b/documentapi/src/main/java/com/yahoo/documentapi/local/LocalDocumentAccess.java index 90bf0bccfdd..6a0f2d6afc2 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/local/LocalDocumentAccess.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/local/LocalDocumentAccess.java @@ -83,7 +83,8 @@ public class LocalDocumentAccess extends DocumentAccess { * and awaits advance before sending each response, so the user can trigger these documents and responses. * After the document or response is delivered, the thread arrives and awaits advance, so the user * can wait until the document or response has been delivered. This also ensures memory visibility. - * The visit sender thread deregisters when the whole visit is complete. Example usage: + * The visit sender thread deregisters when the whole visit is done; the async session threads after each operation. + * Example usage: * * <pre> {@code * void testOperations(LocalDocumentAccess access) { @@ -94,7 +95,7 @@ public class LocalDocumentAccess extends DocumentAccess { * session.put(documentPut); * session.get(documentId); * // Operations wait for this thread to arrive at "phaser" - * phaser.arrive(); // Let operations send their responses + * phaser.arriveAndAwaitAdvance(); // Let operations send their responses * // "responses" may or may not hold the responses now * phaser.arriveAndAwaitAdvance(); // Wait for operations to complete sending responses, memory visibility, etc. * // "responses" now has responses from all previous operations diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java index ea34091879b..1d2f6af35dd 100644 --- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java @@ -208,7 +208,7 @@ public class DocumentOperationExecutorTest { clock.advance(Duration.ofMillis(990)); executor.notifyMaintainers(); // Let doc1 time out. - phaser.arrive(); // Let doc2 arrive. + phaser.arriveAndAwaitAdvance(); // Let doc2 arrive. phaser.arriveAndAwaitAdvance(); // Wait for responses to be delivered. assertEquals(List.of(TIMEOUT), errors); assertEquals(List.of(doc2), received); @@ -225,7 +225,7 @@ public class DocumentOperationExecutorTest { session().setResultType(Result.ResultType.SUCCESS); clock.advance(Duration.ofMillis(20)); executor.notifyMaintainers(); // Retry not attempted since operation already timed out. - phaser.arrive(); + phaser.arriveAndAwaitAdvance(); phaser.arriveAndAwaitAdvance(); assertEquals(List.of(TIMEOUT, TIMEOUT), errors); assertEquals(List.of(doc2), received); |