Segregate handling of Tcp.ErrorClosed command from the rest of Tcp.ConnectionClosed (#4307)

* Segregate handling of Tcp.ErrorClosed command from the rest of Tcp.ConnectionClosed

* Remove old match
This commit is contained in:
Chris Stewart 2022-05-02 06:27:21 -05:00 committed by GitHub
parent fac0713405
commit ce00d3ac36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,8 +290,13 @@ case class P2PClientActor(
context.become(awaitNetworkRequest(peerConnection, unalignedBytes))
unalignedBytes
case Tcp.ErrorClosed(cause) =>
logger.error(
s"An error occurred in our connection with $peer, cause=$cause state=${currentPeerMsgHandlerRecv.state}")
currentPeerMsgHandlerRecv = currentPeerMsgHandlerRecv.disconnect()
unalignedBytes
case closeCmd @ (Tcp.ConfirmedClosed | Tcp.Closed | Tcp.Aborted |
Tcp.PeerClosed | Tcp.ErrorClosed(_)) =>
Tcp.PeerClosed) =>
logger.info(
s"We've been disconnected by $peer command=${closeCmd} state=${currentPeerMsgHandlerRecv.state}")
currentPeerMsgHandlerRecv = currentPeerMsgHandlerRecv.disconnect()