RuedigerMoeller / fast-serialization

FST: fast java serialization drop in-replacement
Apache License 2.0
1.58k stars 248 forks source link

FST 2.57 sometime give me ClassCastException on read #334

Open trixprod opened 1 year ago

trixprod commented 1 year ago

It's pretty hard to debug as it's not always reproductible.

I've got a server which use heavily FST in a testing environment. In 99.99% of cases everything is fine, but sometimes FST deserializes my object badly.

In my observation :

My object is a Map<ZonedDateTime, Set> and FST deserialize it as a ... simple String ?!

Also, in the past, i caught another class occuring : Exptected result was : MyDto(name='ABC',technicalName=null, rank= null). FST was trying to cast my object to the String 'ABC'. My workaround was to fit MyDto with not null fields ... very strange.

In my Map case, i've no workaround to play with so i'm trying to reach some help. Here is my read code, quite simple :

FSTConfiguration config = FSTConfiguration.getDefaultConfiguration(); byte data[] = config.asByteArray(obj);

I'm working in a multithreaded environment ( Java thread ). It's not a memory issue ( mem tested and fine ).

Have you experimented similar situations ? I'm not able to update FST version, i'm stuck with OpenJdk 11.