ARTEMIS-4691 Fixing LockManagerBackupSyncJournalTest

Fixing a few intermittent failures
This commit is contained in:
Clebert Suconic 2024-03-18 10:32:29 -04:00 committed by clebertsuconic
parent 499a4eab6b
commit 308aed3060
3 changed files with 15 additions and 2 deletions

View File

@ -131,6 +131,10 @@ public interface Connection {
*/
void close();
default void disconnect() {
close();
}
/**
* Returns a string representation of the remote address this connection is connected to.
*

View File

@ -243,7 +243,7 @@ public final class InVMAcceptor extends AbstractAcceptor {
Connection conn = connections.get(connectionID);
if (conn != null) {
conn.close();
conn.disconnect();
}
}

View File

@ -142,6 +142,10 @@ public class InVMConnection implements Connection {
@Override
public void close() {
internalClose(false);
}
private void internalClose(boolean failed) {
if (closing) {
return;
}
@ -150,13 +154,18 @@ public class InVMConnection implements Connection {
synchronized (this) {
if (!closed) {
listener.connectionDestroyed(id, false);
listener.connectionDestroyed(id, failed);
closed = true;
}
}
}
@Override
public void disconnect() {
internalClose(true);
}
@Override
public void setAutoRead(boolean autoRead) {
// nothing to be done on the INVM.