mirror of
https://github.com/corda/corda.git
synced 2024-12-24 15:16:45 +00:00
There have been strange serialization errors in tests using the InMemoryMessagingNetwork when run in multi-threaded mode. It appears that the root cause is Kryo transiently modifies the source ByteArray. Therefore we must give each thread/node in the network a separate message data copy.
This commit is contained in:
parent
57975c6e91
commit
6eb74ba10a
@ -374,7 +374,7 @@ class InMemoryMessagingNetwork(val sendManuallyPumped: Boolean) : SingletonSeria
|
|||||||
|
|
||||||
private fun MessageTransfer.toReceivedMessage() = object : ReceivedMessage {
|
private fun MessageTransfer.toReceivedMessage() = object : ReceivedMessage {
|
||||||
override val topicSession: TopicSession get() = message.topicSession
|
override val topicSession: TopicSession get() = message.topicSession
|
||||||
override val data: ByteArray get() = message.data
|
override val data: ByteArray get() = message.data.copyOf() // Kryo messes with the buffer so give each client a unique copy
|
||||||
override val peer: X500Name get() = X509Utilities.getDevX509Name(sender.description)
|
override val peer: X500Name get() = X509Utilities.getDevX509Name(sender.description)
|
||||||
override val debugTimestamp: Instant get() = message.debugTimestamp
|
override val debugTimestamp: Instant get() = message.debugTimestamp
|
||||||
override val uniqueMessageId: UUID get() = message.uniqueMessageId
|
override val uniqueMessageId: UUID get() = message.uniqueMessageId
|
||||||
|
Loading…
Reference in New Issue
Block a user