From 27add8d6cfcebcde3eff678f67168a3119cfb91a Mon Sep 17 00:00:00 2001 From: Nigel Small Date: Thu, 7 Jan 2016 11:07:29 +0000 Subject: [PATCH] Removed ACK_FAILURE --- community/bolt/src/docs/dev/examples.asciidoc | 7 +- .../bolt/src/docs/dev/messaging.asciidoc | 45 +++-------- .../bolt/v1/messaging/MessageHandler.java | 8 -- .../messaging/PackStreamMessageFormatV1.java | 16 ---- .../message/AcknowledgeFailureMessage.java | 54 ------------- .../bolt/v1/messaging/message/Messages.java | 6 -- .../messaging/msgprocess/TransportBridge.java | 6 -- .../org/neo4j/bolt/v1/runtime/Session.java | 15 +--- .../internal/ErrorReportingSession.java | 6 -- .../runtime/internal/SessionStateMachine.java | 26 +------ .../concurrent/SessionWorkerFacade.java | 6 -- .../neo4j/bolt/v1/docs/DocSerialization.java | 77 ++++++++----------- .../bolt/v1/messaging/MessageFormatTest.java | 6 +- .../v1/messaging/RecordingMessageHandler.java | 8 -- .../v1/runtime/integration/SessionIT.java | 2 +- .../internal/SessionStateMachineTest.java | 4 +- .../internal/StateMachineErrorTest.java | 4 +- 17 files changed, 60 insertions(+), 236 deletions(-) delete mode 100644 community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/AcknowledgeFailureMessage.java diff --git a/community/bolt/src/docs/dev/examples.asciidoc b/community/bolt/src/docs/dev/examples.asciidoc index ba132e1317e4e..47805f8e7f5e6 100644 --- a/community/bolt/src/docs/dev/examples.asciidoc +++ b/community/bolt/src/docs/dev/examples.asciidoc @@ -122,8 +122,7 @@ Server: SUCCESS { "type": "r" } === Error handling -This illustrates how the server behaves when a request fails, and the server ignores incoming messages until an -`ACK_FAILURE` message is received. +This illustrates how the server behaves when a request fails, and shows how the server ignores incoming messages until a `RESET` message is received. .Error handling [source,bolt_exchange] @@ -180,9 +179,9 @@ Server: IGNORED # Until the error is acknowledged -Client: ACK_FAILURE +Client: RESET - 00 02 b0 0f 00 00 + 00 02 b0 02 00 00 Server: SUCCESS {} diff --git a/community/bolt/src/docs/dev/messaging.asciidoc b/community/bolt/src/docs/dev/messaging.asciidoc index 36a181c2fa0b6..83bc6a81f8bbb 100644 --- a/community/bolt/src/docs/dev/messaging.asciidoc +++ b/community/bolt/src/docs/dev/messaging.asciidoc @@ -46,10 +46,11 @@ Because the protocol leverages pipelining, the client and the server need to agr occurs, otherwise messages that were sent assuming no failure would occur might have unintended effects. When requests fail on the server, the server will send the client a `FAILURE` message. -The client must acknowledge the `FAILURE` message by sending an `ACK_FAILURE` message to the server. -Until the server receives the `ACK_FAILURE` message, it will send an `IGNORED` message in response to any other message from by the client, including messages that were sent in a pipeline. +The client must acknowledge the `FAILURE` message by sending an `RESET` message to the server. +Until the server receives the `RESET` message, it will send an `IGNORED` message in response to any other message from by the client, including messages that were sent in a pipeline. +The `RESET` clears the pending failure state, disposes of any outstanding records and rolls back the current transaction (if any). -The diagram below illustrates a typical flow involving `ACK_FAILURE` messages: +The diagram below illustrates a typical flow involving `RESET` messages: image:failure-ack.png[] @@ -200,38 +201,14 @@ Value: PULL_ALL B0 3F ---- -==== ACK_FAILURE - -The `ACK_FAILURE` message is a client message used to signal that a client has acknowledged a previous `FAILURE` -. It has the following structure: - -[source,bolt_message_struct] ----- -AcknowledgeFailureMessage (signature=0x0F) { -} ----- - -On receipt of an `ACK_FAILURE` message, the server will clear any pending failure state and respond with a single `SUCCESS` message. -If no such failure state is pending, a FAILURE message will be sent instead. - -An `ACK_FAILURE` will never be ignored by the server. - -.Response -- `SUCCESS {}` if a failure has been successfully acknowledged -- `FAILURE {"code": ..., "message": ...}` if there is no outstanding failure that requires acknowledgement - -.Example -[source,bolt_packstream_type] ----- -Value: ACK_FAILURE - -B0 0F ----- - ==== RESET -The `RESET` message is a client message used to return the current session to a "clean" state by discarding any outstanding records and rolling back the current transaction, if one exists. -`RESET` will also override any outstanding `FAILURE` and can therefore be used in place of an `ACK_FAILURE` (albeit with extra power). +The `RESET` message is a client message used to return the current session to a "clean" state. +The following actions are performed by `RESET`: + +- clear any outstanding `FAILURE` state +- dispose of any outstanding result records +- rollback the current transaction (if any) [source,bolt_message_struct] ---- @@ -339,7 +316,7 @@ IgnoredMessage (signature=0x7E) { } ---- -A client message will be ignored if an earlier failure has not yet been acknowledged by the client via an `ACK_FAILURE` message. +A client message will be ignored if an earlier failure has not yet been acknowledged by the client via a `RESET` message. For example, this will occur if the client optimistically sends a group of messages, one of which fails during execution: all subsequent messages in that group will then be ignored. Note that the original `PULL_ALL` message was never processed by the server. diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/MessageHandler.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/MessageHandler.java index 78d5d78b9c6f0..84ae0b170e1cd 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/MessageHandler.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/MessageHandler.java @@ -32,8 +32,6 @@ public interface MessageHandler void handleDiscardAllMessage() throws E; - void handleAckFailureMessage() throws E; - void handleRecordMessage( Record item ) throws E; void handleSuccessMessage( Map metadata ) throws E; @@ -66,12 +64,6 @@ public void handleDiscardAllMessage() throws E } - @Override - public void handleAckFailureMessage() throws E - { - - } - @Override public void handleRecordMessage( Record item ) throws E { diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/PackStreamMessageFormatV1.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/PackStreamMessageFormatV1.java index 8d00c23857374..152ddfbdeaf8d 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/PackStreamMessageFormatV1.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/PackStreamMessageFormatV1.java @@ -129,13 +129,6 @@ public void handleDiscardAllMessage() onMessageComplete.onMessageComplete(); } - @Override - public void handleAckFailureMessage() throws IOException - { - packer.packStructHeader( 0, MessageTypes.MSG_ACK_FAILURE ); - onMessageComplete.onMessageComplete(); - } - @Override public void handleRecordMessage( Record item ) throws IOException @@ -253,9 +246,6 @@ public void read( MessageHandler output ) throws IOExce case MessageTypes.MSG_FAILURE: unpackFailureMessage( output ); break; - case MessageTypes.MSG_ACK_FAILURE: - unpackAckFailureMessage( output ); - break; case MessageTypes.MSG_IGNORED: unpackIgnoredMessage( output ); break; @@ -284,12 +274,6 @@ public void read( MessageHandler output ) throws IOExce } } - private void unpackAckFailureMessage( MessageHandler output ) - throws E - { - output.handleAckFailureMessage(); - } - private void unpackSuccessMessage( MessageHandler output ) throws E, IOException { diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/AcknowledgeFailureMessage.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/AcknowledgeFailureMessage.java deleted file mode 100644 index 4c47ab0f01f9a..0000000000000 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/AcknowledgeFailureMessage.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002-2016 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.bolt.v1.messaging.message; - -import org.neo4j.bolt.v1.messaging.MessageHandler; - -public class AcknowledgeFailureMessage implements Message -{ - @Override - public void dispatch( MessageHandler consumer ) throws E - { - consumer.handleAckFailureMessage(); - } - - @Override - public boolean equals( Object o ) - { - if ( this == o ) - { - return true; - } - return !(o == null || getClass() != o.getClass()); - - } - - @Override - public int hashCode() - { - return 1; - } - - @Override - public String toString() - { - return "AcknowledgeFailureMessage{}"; - } -} diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/Messages.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/Messages.java index 1764c4370daba..95a3315275b7d 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/Messages.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/message/Messages.java @@ -28,7 +28,6 @@ public class Messages { private static final PullAllMessage PULL_ALL = new PullAllMessage(); private static final DiscardAllMessage DISCARD_ALL = new DiscardAllMessage(); - private static final AcknowledgeFailureMessage ACK_FAILURE = new AcknowledgeFailureMessage(); private static final SuccessMessage SUCCESS = new SuccessMessage( Collections.EMPTY_MAP ); public static Message reset() @@ -61,11 +60,6 @@ public static Message discardAll() return DISCARD_ALL; } - public static Message ackFailure() - { - return ACK_FAILURE; - } - public static Message record( Record value ) { return new RecordMessage( value ); diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/msgprocess/TransportBridge.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/msgprocess/TransportBridge.java index aaf84052da30a..1eb5eb6fec289 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/msgprocess/TransportBridge.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/messaging/msgprocess/TransportBridge.java @@ -84,12 +84,6 @@ public void handleDiscardAllMessage() session.discardAll( null, simpleCallback ); } - @Override - public void handleAckFailureMessage() throws RuntimeException - { - session.acknowledgeFailure( null, simpleCallback ); - } - @Override public void handleResetMessage() throws RuntimeException { diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/Session.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/Session.java index f5ffc13183b23..e1b3f834d40b7 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/Session.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/Session.java @@ -137,19 +137,8 @@ public static Callback noop() void discardAll( A attachment, Callback callback ); /** - * Whenever an error has occurred, all incoming requests will be ignored until the error is acknowledged through - * this method. The point of this is that we can do pipelining, sending multiple requests in one go and - * optimistically assuming they will succeed. If any of them fail all subsequent requests are declined until the - * client has acknowledged it has seen the error and has taken it into account for upcoming requests. - *

- * Whenever an error has been acknowledged, the session will revert back to its intial state. Any ongoing - * statements - * or transactions will have been rolled back and/or disposed of. - */ - void acknowledgeFailure( A attachment, Callback callback ); - - /** - * Reset the session to an IDLE state. + * Reset the session to an IDLE state. This clears any outstanding failure condition, disposes + * of any outstanding result records and rolls back the current transaction (if any). */ void reset( A attachment, Callback callback ); diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/ErrorReportingSession.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/ErrorReportingSession.java index b9c83b2e43a0a..c3e2811c89ac6 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/ErrorReportingSession.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/ErrorReportingSession.java @@ -76,12 +76,6 @@ public void discardAll( A attachment, Callback callback ) reportError( attachment, callback ); } - @Override - public void acknowledgeFailure( A attachment, Callback callback ) - { - reportError( attachment, callback ); - } - @Override public void reset( A attachment, Callback callback ) { diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachine.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachine.java index 65f9ee107d6fb..853fd9583dafd 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachine.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachine.java @@ -236,16 +236,10 @@ public State reset( SessionStateMachine ctx ) /** An error has occurred, client must acknowledge it before anything else is allowed. */ ERROR { - @Override - public State acknowledgeError( SessionStateMachine ctx ) - { - return IDLE; - } - @Override public State reset( SessionStateMachine ctx ) { - return acknowledgeError( ctx ); + return IDLE; } @Override @@ -263,7 +257,7 @@ protected State onNoImplementation( SessionStateMachine ctx, String command ) RECOVERABLE_ERROR { @Override - public State acknowledgeError (SessionStateMachine ctx) + public State reset (SessionStateMachine ctx) { return IN_TRANSACTION; } @@ -336,11 +330,6 @@ public State beginTransaction( SessionStateMachine ctx ) return onNoImplementation( ctx, "beginning implicit transaction" ); } - public State acknowledgeError( SessionStateMachine ctx ) - { - return onNoImplementation( ctx, "acknowledging an error" ); - } - public State reset( SessionStateMachine ctx ) { return onNoImplementation( ctx, "resetting the current session" ); @@ -521,17 +510,6 @@ public void discardAll( A attachment, Callback callback ) finally { after(); } } - @Override - public void acknowledgeFailure( A attachment, Callback callback ) - { - before( attachment, callback ); - try - { - state = state.acknowledgeError( this ); - } - finally { after(); } - } - @Override public void reset( A attachment, Callback callback ) { diff --git a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/concurrent/SessionWorkerFacade.java b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/concurrent/SessionWorkerFacade.java index d558490044c16..847c0adff0395 100644 --- a/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/concurrent/SessionWorkerFacade.java +++ b/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/concurrent/SessionWorkerFacade.java @@ -71,12 +71,6 @@ public void discardAll( final A attachment, final Callback callback queue( session -> session.discardAll( attachment, callback ) ); } - @Override - public void acknowledgeFailure( final A attachment, final Callback callback ) - { - queue( session -> session.acknowledgeFailure( attachment, callback ) ); - } - @Override public void reset( final A attachment, final Callback callback ) { diff --git a/community/bolt/src/test/java/org/neo4j/bolt/v1/docs/DocSerialization.java b/community/bolt/src/test/java/org/neo4j/bolt/v1/docs/DocSerialization.java index 9d2899d814efc..eafa647ac71f3 100644 --- a/community/bolt/src/test/java/org/neo4j/bolt/v1/docs/DocSerialization.java +++ b/community/bolt/src/test/java/org/neo4j/bolt/v1/docs/DocSerialization.java @@ -137,50 +137,41 @@ else if ( value.equals( "FAILURE { \"code\": \"Neo.ClientError.Statement.Invalid } } - if ( type.equals( "DISCARD_ALL" ) ) + switch ( type ) { - writer.handleDiscardAllMessage(); - } - else if ( type.equals( "PULL_ALL" ) ) - { - writer.handlePullAllMessage(); - } - else if ( type.equals( "ACK_FAILURE" ) ) - { - writer.handleAckFailureMessage(); - } - else if ( type.equals( "IGNORED" ) ) - { - writer.handleIgnoredMessage(); - } - else if( type.equals( "RUN" )) - { - writer.handleRunMessage( (String)args.get( 0 ), (Map)args.get( 1 ) ); - } - else if( type.equals( "RECORD" )) - { - writer.handleRecordMessage( new ImmutableRecord( Iterables.toArray(Object.class, (List)args.get( 0 )) ) ); - } - else if( type.equals( "SUCCESS" )) - { - writer.handleSuccessMessage( (Map)args.get( 0 ) ); - } - else if( type.equals( "FAILURE" )) - { - Map meta = (Map) args.get( 0 ); - writer.handleFailureMessage( Neo4jError.codeFromString( (String) meta.get( "code" ) ), (String) meta.get( "message" ) ); - } - else if( type.equals( "INIT" )) - { - writer.handleInitMessage( (String) args.get( 0 ) ); - } - else if( type.equals( "RESET" )) - { - writer.handleResetMessage(); - } - else - { - throw new RuntimeException( "Unknown value: " + type ); + case "DISCARD_ALL": + writer.handleDiscardAllMessage(); + break; + case "PULL_ALL": + writer.handlePullAllMessage(); + break; + case "IGNORED": + writer.handleIgnoredMessage(); + break; + case "RUN": + writer.handleRunMessage( (String) args.get( 0 ), + (Map) args.get( 1 ) ); + break; + case "RECORD": + writer.handleRecordMessage( new ImmutableRecord( Iterables.toArray( + Object.class, (List) args.get( 0 ) ) ) ); + break; + case "SUCCESS": + writer.handleSuccessMessage( (Map) args.get( 0 ) ); + break; + case "FAILURE": + Map meta = (Map) args.get( 0 ); + writer.handleFailureMessage( Neo4jError.codeFromString( + (String) meta.get( "code" ) ), (String) meta.get( "message" ) ); + break; + case "INIT": + writer.handleInitMessage( (String) args.get( 0 ) ); + break; + case "RESET": + writer.handleResetMessage(); + break; + default: + throw new RuntimeException( "Unknown value: " + type ); } } } diff --git a/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/MessageFormatTest.java b/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/MessageFormatTest.java index 9457f50675736..945332a927485 100644 --- a/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/MessageFormatTest.java +++ b/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/MessageFormatTest.java @@ -26,13 +26,13 @@ import org.junit.Test; +import org.neo4j.bolt.v1.messaging.message.ResetMessage; import org.neo4j.graphdb.Path; import org.neo4j.graphdb.RelationshipType; import org.neo4j.kernel.api.exceptions.Status; import org.neo4j.kernel.impl.util.HexPrinter; import org.neo4j.bolt.v1.messaging.infrastructure.ValueNode; import org.neo4j.bolt.v1.messaging.infrastructure.ValueRelationship; -import org.neo4j.bolt.v1.messaging.message.AcknowledgeFailureMessage; import org.neo4j.bolt.v1.messaging.message.DiscardAllMessage; import org.neo4j.bolt.v1.messaging.message.FailureMessage; import org.neo4j.bolt.v1.messaging.message.IgnoredMessage; @@ -65,10 +65,10 @@ public void shouldHandleCommonMessages() throws Throwable assertSerializes( new DiscardAllMessage() ); assertSerializes( new PullAllMessage() ); assertSerializes( new RecordMessage( record( 1l, "b", 2l ) ) ); - assertSerializes( new SuccessMessage( new HashMap() ) ); + assertSerializes( new SuccessMessage( new HashMap<>() ) ); assertSerializes( new FailureMessage( Status.General.UnknownFailure, "Err" ) ); assertSerializes( new IgnoredMessage() ); - assertSerializes( new AcknowledgeFailureMessage() ); + assertSerializes( new ResetMessage() ); assertSerializes( new InitMessage( "MyClient/1.0" ) ); } diff --git a/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/RecordingMessageHandler.java b/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/RecordingMessageHandler.java index cc0732165d696..5d9074010156f 100644 --- a/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/RecordingMessageHandler.java +++ b/community/bolt/src/test/java/org/neo4j/bolt/v1/messaging/RecordingMessageHandler.java @@ -23,8 +23,6 @@ import java.util.List; import java.util.Map; -import org.neo4j.bolt.v1.messaging.MessageHandler; -import org.neo4j.bolt.v1.messaging.message.AcknowledgeFailureMessage; import org.neo4j.bolt.v1.messaging.message.DiscardAllMessage; import org.neo4j.bolt.v1.messaging.message.FailureMessage; import org.neo4j.bolt.v1.messaging.message.IgnoredMessage; @@ -60,12 +58,6 @@ public void handleDiscardAllMessage() messages.add( new DiscardAllMessage() ); } - @Override - public void handleAckFailureMessage() throws RuntimeException - { - messages.add( new AcknowledgeFailureMessage() ); - } - @Override public void handleRecordMessage( Record item ) { diff --git a/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/integration/SessionIT.java b/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/integration/SessionIT.java index 03637835ca557..72cb072e2716f 100644 --- a/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/integration/SessionIT.java +++ b/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/integration/SessionIT.java @@ -377,7 +377,7 @@ public void shouldAllowNewTransactionAfterFailure() throws Throwable // And given I've started a transaction that failed runAndPull( session, "BEGIN" ); session.run( "invalid", EMPTY_PARAMS, null, Session.Callbacks.noop() ); - session.acknowledgeFailure( null, Session.Callbacks.noop() ); + session.reset( null, Session.Callbacks.noop() ); // When runAndPull( session, "BEGIN" ); diff --git a/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachineTest.java b/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachineTest.java index d5bf6bbea5bd4..88b4d3d5338be 100644 --- a/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachineTest.java +++ b/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/SessionStateMachineTest.java @@ -86,7 +86,7 @@ public void shouldRollbackOpenTransactionOnRollbackInducingError() throws Throwa verify( tx ).close(); // And when - machine.acknowledgeFailure( null, Session.Callback.NO_OP ); + machine.reset( null, Session.Callback.NO_OP ); // Then the machine goes back to an idle (no open transaction) state assertThat( machine.state(), CoreMatchers.equalTo( SessionStateMachine.State.IDLE ) ); @@ -113,7 +113,7 @@ public void shouldNotLeaveTransactionOpenOnClientErrors() throws Throwable verify(tx).close(); // And when - machine.acknowledgeFailure( null, Session.Callback.NO_OP ); + machine.reset( null, Session.Callback.NO_OP ); // Then the machine goes back to an idle (no open transaction) state assertThat( machine.state(), equalTo( SessionStateMachine.State.IDLE ) ); diff --git a/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/StateMachineErrorTest.java b/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/StateMachineErrorTest.java index f3f6f21f29aca..69544bc724b6e 100644 --- a/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/StateMachineErrorTest.java +++ b/community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/internal/StateMachineErrorTest.java @@ -185,7 +185,7 @@ public void testCantDoAnythingIfInErrorState() throws Throwable } @Test - public void testAcknowledgingError() throws Throwable + public void testUsingResetToAcknowledgeError() throws Throwable { // Given RecordingCallback messages = new RecordingCallback<>(); @@ -197,7 +197,7 @@ public void testAcknowledgingError() throws Throwable machine.commitTransaction(); // No tx to be committed! // When - machine.acknowledgeFailure( null, failures ); + machine.reset( null, failures ); // Then assertThat( failures.next(), SessionMatchers.success() );