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)
|
message.payload = rawInput.readBytes(dataLength)
|
||||||
|
|
||||||
|
|
||||||
// NOTE: This MUST be on a new co-routine
|
// NOTE: This MUST NOT be on a new co-routine. It must be on the same thread!
|
||||||
actionDispatch.launch {
|
|
||||||
try {
|
try {
|
||||||
streamingManager.processDataMessage(message, this@EndPoint)
|
streamingManager.processDataMessage(message, this@EndPoint)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@ -533,7 +532,6 @@ internal constructor(val type: Class<*>,
|
|||||||
listenerManager.notifyError(connection, e)
|
listenerManager.notifyError(connection, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
is Any -> {
|
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"
|
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!
|
// 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`
|
// +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
|
// +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
|
* Reassemble/figure out the internal message pieces
|
||||||
*
|
*
|
||||||
* NOTE sending a huge file can prevent other other network traffic from arriving until it's done!
|
* 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