ARTEMIS-4691 Fixing LockManagerBackupSyncJournalTest
Fixing a few intermittent failures
This commit is contained in:
parent
499a4eab6b
commit
308aed3060
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -243,7 +243,7 @@ public final class InVMAcceptor extends AbstractAcceptor {
|
|||
Connection conn = connections.get(connectionID);
|
||||
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
conn.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue