mirror of
https://github.com/corda/corda.git
synced 2024-12-22 06:17:55 +00:00
CORDA-1064 - Fix a hang in AMQP protocol code that occurs when pausing in debugger causes protocol timeout, but wasn't driving event procesing to actuially kill the socket. (#2557) (#2559)
This commit is contained in:
parent
c0448a0e3c
commit
9a339fbac7
@ -168,12 +168,14 @@ internal class ConnectionStateMachine(serverMode: Boolean,
|
||||
val transport = event.transport
|
||||
log.debug { "Transport Head Closed $transport" }
|
||||
transport.close_tail()
|
||||
onTransportInternal(transport)
|
||||
}
|
||||
|
||||
override fun onTransportTailClosed(event: Event) {
|
||||
val transport = event.transport
|
||||
log.debug { "Transport Tail Closed $transport" }
|
||||
transport.close_head()
|
||||
onTransportInternal(transport)
|
||||
}
|
||||
|
||||
override fun onTransportClosed(event: Event) {
|
||||
@ -195,6 +197,7 @@ internal class ConnectionStateMachine(serverMode: Boolean,
|
||||
} else {
|
||||
log.info("Error (no description returned).")
|
||||
}
|
||||
onTransportInternal(transport)
|
||||
}
|
||||
|
||||
override fun onTransport(event: Event) {
|
||||
|
@ -79,7 +79,10 @@ internal class EventProcessor(channel: Channel,
|
||||
if ((connection.localState != EndpointState.CLOSED) && !connection.transport.isClosed) {
|
||||
val now = System.currentTimeMillis()
|
||||
val tickDelay = Math.max(0L, connection.transport.tick(now) - now)
|
||||
executor.schedule({ tick(connection) }, tickDelay, TimeUnit.MILLISECONDS)
|
||||
executor.schedule({
|
||||
tick(connection)
|
||||
processEvents()
|
||||
}, tickDelay, TimeUnit.MILLISECONDS)
|
||||
}
|
||||
} catch (ex: Exception) {
|
||||
connection.transport.close()
|
||||
|
Loading…
Reference in New Issue
Block a user