Several tests were corrupting Kryo which was then returned to the common pool. (#378)

* We were leaving trailing attachmentStorage on pooled kryo instances after some tests.  Changed attachment storage logic to make it impossible to leave it behind.

* Some low level tests corrupt the Kryo config, so do not return to pool when this is the case.  Also, we discovered that Kryo is caching class name to class resolution.  We don't want to do this where attachments are involved.  The errors raised highlighted a class missing from the whitelist.  Need to write a unit test to test the class loader issue.

* Unit test for attachment class loading with kryo.
This commit is contained in:
Rick Parker
2017-03-17 12:43:11 +00:00
committed by GitHub
parent 486368d926
commit 1de1f9095f
5 changed files with 68 additions and 37 deletions

View File

@ -6,6 +6,7 @@ import net.corda.core.node.CordaPluginRegistry
import net.corda.core.serialization.SerializationCustomization
import org.apache.activemq.artemis.api.core.SimpleString
import rx.Notification
import rx.exceptions.OnErrorNotImplementedException
import java.math.BigDecimal
import java.time.LocalDate
import java.time.Period
@ -49,6 +50,7 @@ class DefaultWhitelist : CordaPluginRegistry() {
addToWhitelist(LocalDate::class.java)
addToWhitelist(Period::class.java)
addToWhitelist(BitSet::class.java)
addToWhitelist(OnErrorNotImplementedException::class.java)
}
return true
}