Use ConnectionLostException after heartbeat failures

ConnectionLostException was applies only after the WebSocket library
notified us of a session close. However, read inactivity and heartbeat
send failures are also cases of the connection being lost rather than
closed intentionally.

This commit also ensures resetConnection is called after a heartbeat
write failure, consistent with other places where a transport error
is handled that implies the connection is lost.

See gh-32195
This commit is contained in:
rstoyanchev
2024-02-13 10:33:30 +00:00
parent 6a5953dca3
commit 6be0432e3d
3 changed files with 17 additions and 8 deletions

View File

@@ -221,7 +221,7 @@ public class DefaultStompSessionTests {
reset(this.sessionHandler);
readTask.run();
verify(this.sessionHandler).handleTransportError(same(this.session), any(IllegalStateException.class));
verify(this.sessionHandler).handleTransportError(same(this.session), any(ConnectionLostException.class));
verifyNoMoreInteractions(this.sessionHandler);
}