fury icon indicating copy to clipboard operation
fury copied to clipboard

[Java] Create sequential serializer failed

Open qinzhikui opened this issue 1 year ago • 6 comments

Describe the bug

java.lang.RuntimeException: Create sequential serializer failed
at io.fury.serializer.CodegenSerializer.loadCodegenSerializer(CodegenSerializer.java:48)
	at io.fury.resolver.ClassResolver.lambda$getObjectSerializerClass$2(ClassResolver.java:949)
	at io.fury.builder.JITContext.registerSerializerJITCallback(JITContext.java:132)
	at io.fury.resolver.ClassResolver.getObjectSerializerClass(ClassResolver.java:947)
	at io.fury.resolver.ClassResolver.getSerializerClass(ClassResolver.java:902)
	at io.fury.resolver.ClassResolver.getSerializerClass(ClassResolver.java:805)
	at io.fury.resolver.ClassResolver.createSerializer(ClassResolver.java:1161)
	at io.fury.resolver.ClassResolver.getOrUpdateClassInfo(ClassResolver.java:1101)
...
Caused by: java.lang.IllegalStateException: Impossible because we just compiled class
	at io.fury.builder.CodecUtils.loadOrGenCodecClass(CodecUtils.java:95)
	at io.fury.builder.CodecUtils.loadOrGenObjectCodecClass(CodecUtils.java:40)
	at io.fury.serializer.CodegenSerializer.loadCodegenSerializer(CodegenSerializer.java:45)
	... 65 more
Caused by: java.lang.ClassNotFoundException: 
	at io.fury.util.ClassLoaderUtils$ByteArrayClassLoader.findClass(ClassLoaderUtils.java:209)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at io.fury.util.ClassLoaderUtils$ByteArrayClassLoader.loadClass(ClassLoaderUtils.java:225)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at io.fury.builder.CodecUtils.loadOrGenCodecClass(CodecUtils.java:93)
	... 67 more

Expected behavior A clear and concise description of what you expected to happen.

To Reproduce Steps to reproduce the behavior. Please try to provide a reproducible script.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information): Please specify the versions of Fury, OS, and others such as JDK/Python/Gcc/Clang/Go/NodeJS if they are used.

qinzhikui avatar Nov 30 '23 06:11 qinzhikui

@qinzhikui thanks for creating this issue, could you provide the reproduction code and fury version?

chaokunyang avatar Nov 30 '23 06:11 chaokunyang

@qinzhikui thanks for creating this issue, could you provide the reproduction code and fury version?

Fury version 0.3.0. I cannot reproduce it locally. I use ThreadLocalFury in production. Most threads are fine, only a few threads will have this problem. I find this log 'Compile [class] take xxx ms' I found that one thread will print 'Compile [class] take xxx ms', but other threads will generate the above exception

`private ThreadSafeFury fury;

public FuryOHCacheSerializer(Class clazz) {
    fury = new ThreadLocalFury(classLoader -> {
        Fury f = Fury
                .builder()
                .withLanguage(Language.JAVA)
                .withClassLoader(classLoader)
                .build();
        f.register(clazz);
        return f;
    });
}`

qinzhikui avatar Nov 30 '23 06:11 qinzhikui

Seems this is a multi-thread related issue, but it's not easy to figure out what happend without the reproduction code. I checked the implementation, this exception should not happen.

chaokunyang avatar Nov 30 '23 15:11 chaokunyang

close it first and see if anyone else is encountering this problem

qinzhikui avatar Dec 01 '23 08:12 qinzhikui

I'll try to reproduce it, and give you feedbacks if I make it

chaokunyang avatar Dec 01 '23 16:12 chaokunyang

Looks like we're seeing the same issue. https://github.com/apache/incubator-fury/issues/1325

andyczerwonka avatar Jan 09 '24 17:01 andyczerwonka