File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/io/axoniq/axonserver/connector/event/impl Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ public void openConnection(InitializationProperties initializationProperties) {
131131 * streams, and those closed with the intent to re-establish a connection.
132132 */
133133 public void triggerReconnect () {
134+ if (closed .get ()) {
135+ logger .info ("{}: Already closed, cannot trigger reconnect" , streamId );
136+ return ;
137+ }
134138 // first, close gracefully
135139 close ();
136140 AxonServerException reconnectRequested = new AxonServerException (ErrorCategory .OTHER ,
@@ -259,7 +263,11 @@ private void sendCompleted() {
259263 }
260264
261265 private void close (Throwable throwable ) {
262- closed .set (true );
266+ boolean wasClosed = closed .getAndSet (true );
267+ if (wasClosed ) {
268+ logger .info ("{}: Already closed, cannot close again" , streamId );
269+ return ;
270+ }
263271 openSegments .forEach ((segment , buffer ) -> {
264272 try {
265273 if (throwable != null ) {
You can’t perform that action at this time.
0 commit comments