Fixed race condition when we reassemble streaming/chunked data.
This commit is contained in:
parent
683abcbe59
commit
09f367963f
@ -524,8 +524,7 @@ internal constructor(val type: Class<*>,
|
||||
message.payload = rawInput.readBytes(dataLength)
|
||||
|
||||
|
||||
// NOTE: This MUST be on a new co-routine
|
||||
actionDispatch.launch {
|
||||
// NOTE: This MUST NOT be on a new co-routine. It must be on the same thread!
|
||||
try {
|
||||
streamingManager.processDataMessage(message, this@EndPoint)
|
||||
} catch (e: Exception) {
|
||||
@ -533,7 +532,6 @@ internal constructor(val type: Class<*>,
|
||||
listenerManager.notifyError(connection, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
is Any -> {
|
||||
|
@ -110,7 +110,7 @@ internal class StreamingManager<CONNECTION : Connection>(private val logger: KLo
|
||||
val errorMessage = "Error serializing message from received streaming content, stream $streamId"
|
||||
|
||||
// either client or server. No other choices. We create an exception, because it's more useful!
|
||||
val exception = endPoint.newException(errorMessage)
|
||||
val exception = endPoint.newException(errorMessage, e)
|
||||
|
||||
// +2 because we do not want to see the stack for the abstract `newException`
|
||||
// +3 more because we do not need to see the "internals" for sending messages. The important part of the stack trace is
|
||||
@ -174,6 +174,8 @@ internal class StreamingManager<CONNECTION : Connection>(private val logger: KLo
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: MUST BE ON THE AERON THREAD!
|
||||
*
|
||||
* Reassemble/figure out the internal message pieces
|
||||
*
|
||||
* NOTE sending a huge file can prevent other other network traffic from arriving until it's done!
|
||||
|
Loading…
Reference in New Issue
Block a user