Merge pull request #4153 from eclipse/jetty-9.4.x-3558-websocket_onErrorAfterClose
Issue #3558 - only notify WS onError if onClose has not been called
This commit is contained in:
commit
00baa7147e
|
@ -41,6 +41,7 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class ConcurrentConnectTest
|
||||
|
@ -130,7 +131,7 @@ public class ConcurrentConnectTest
|
|||
assertTrue(l.closed.await(5, TimeUnit.SECONDS));
|
||||
assertThat(l.closeCode, is(StatusCode.NORMAL));
|
||||
assertThat(l.closeReason, is("close from client"));
|
||||
//assertNull(l.failure); //TODO: we can get failures after close??
|
||||
assertNull(l.failure);
|
||||
}
|
||||
|
||||
closeListener.closeLatch.await(5, TimeUnit.SECONDS);
|
||||
|
|
|
@ -397,7 +397,10 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Rem
|
|||
}
|
||||
if (openFuture != null && !openFuture.isDone())
|
||||
openFuture.completeExceptionally(cause);
|
||||
websocket.onError(cause);
|
||||
|
||||
// Only notify onError if onClose has not been called.
|
||||
if (!onCloseCalled.get())
|
||||
websocket.onError(cause);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue