portkey-cloud / portkey

Live-coding the Cloud
144 stars 7 forks source link

`portkey.core-test/instaparse` #44

Open cgrand opened 6 years ago

cgrand commented 6 years ago

Error reads

Caused by: java.lang.UnsupportedOperationException: null
 at clojure.lang.ASeq.add (ASeq.java:151)
    com.esotericsoftware.kryo.serializers.CollectionSerializer.read (CollectionSerializer.java:134)
    com.esotericsoftware.kryo.serializers.CollectionSerializer.read (CollectionSerializer.java:40)

It means we are deserializing a descendant of ASeq but Kryo is using its standard CollectionSerializer which is meant for mutable collections that's why it calls Collection/add which is not supported by the type at hand.

Next step: figure out this type.

cgrand commented 6 years ago

That's an interesting puzzle. When I add clojure.lang.ChunkedCons carbonite.ClojureSeqSerializer (or com.esotericsoftware.kryo.serializers.FieldSerializer) to default-serializers in portkey.kryo then I get this exception: S occurs on the right-hand side of your grammar, but not on the left

Is this another bug?

cgrand commented 6 years ago

I have a strong suspect https://github.com/Engelberg/instaparse/blob/6089f581a2c34a0e62405bffe16f0dee27ba1b7f/src/instaparse/auto_flatten_seq.cljc#L87

cgrand commented 6 years ago

Hmmm no. This type (nor FlattenOnDemandVector) throws an exception when roundtripped through kryo. Since we get no exceptions, they are not part of the serialization.