IdentityObjectIntMap check new size before resize#1198
IdentityObjectIntMap check new size before resize#1198cxzl25 wants to merge 1 commit intoEsotericSoftware:kryo-4from
Conversation
|
Could you help review this PR? @theigl |
|
This additional check is ok, but I don't fully understand how throwing an IAE helps in your case. Is it just to fail as fast as possible? I see you are targeting Kryo 4.x which is not maintained anymore. Even if I merge this PR, I cannot guarantee that there will be a release any time soon. |
In order to reuse the same kryo object, we used
I saw your fix in Kryo 5.x. ObjectMap did some size checks. This problem should not appear in 5.x. |
Problem
In Spark, it uses kryo pool, which reuses the same kryo object, but when IdentityObjectIntMap resize throws
NegativeArraySizeExceptionexception, reuse the object again, always throwsArrayIndexOutOfBoundsExceptionexceptionBecause resize first updated the mask variable, but the keyTable update failed, which caused an error in calculating the object index the next time.
Stack trace
Simple test