Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Avoid NPE during disposing ArcticServiceContainer #1985

Closed
2 tasks done
Tracked by #1930
rfyu opened this issue Sep 17, 2023 · 0 comments · Fixed by #1986
Closed
2 tasks done
Tracked by #1930

[Bug]: Avoid NPE during disposing ArcticServiceContainer #1985

rfyu opened this issue Sep 17, 2023 · 0 comments · Fixed by #1986
Labels
type:bug Something isn't working

Comments

@rfyu
Copy link
Contributor

rfyu commented Sep 17, 2023

What happened?

Before calling the cancel method of com.netease.arctic.server.DefaultOptimizingService#optimizerMonitorTimer, we should first check whether it is null to avoid the following NullPointerException. We don't need to worry about the InvalidClassException because it occurred due to the lack of updating the database after the upgrade.

Affects Versions

0.5.0

What engines are you seeing the problem on?

AMS

How to reproduce

No response

Relevant log output

2023-09-14 15:29:19,314 ERROR [main] [com.netease.arctic.server.ArcticServiceContainer] [] - AMS start error
java.lang.IllegalArgumentException: deserialization error
        at com.netease.arctic.utils.SerializationUtil.simpleDeserialize(SerializationUtil.java:75) ~[amoro-core-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.persistence.TaskFilesPersistence.loadTaskInputs(TaskFilesPersistence.java:31) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.optimizing.OptimizingQueue$TableOptimizingProcess.loadTaskRuntimes(OptimizingQueue.java:611) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.optimizing.OptimizingQueue$TableOptimizingProcess.<init>(OptimizingQueue.java:388) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.optimizing.OptimizingQueue.initTableRuntime(OptimizingQueue.java:93) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_291]
        at com.netease.arctic.server.optimizing.OptimizingQueue.<init>(OptimizingQueue.java:86) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.DefaultOptimizingService.lambda$loadOptimizingQueues$1(DefaultOptimizingService.java:110) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_291]
        at com.netease.arctic.server.DefaultOptimizingService.loadOptimizingQueues(DefaultOptimizingService.java:104) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.DefaultOptimizingService$TableRuntimeHandlerImpl.initHandler(DefaultOptimizingService.java:346) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.table.RuntimeHandlerChain.initialize(RuntimeHandlerChain.java:32) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.table.DefaultTableService.initialize(DefaultTableService.java:311) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.ArcticServiceContainer.startService(ArcticServiceContainer.java:142) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.ArcticServiceContainer.main(ArcticServiceContainer.java:106) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
Caused by: java.io.InvalidClassException: com.netease.arctic.optimizing.RewriteFilesInput; local class incompatible: stream classdesc serialVersionUID = 1106605615053484570, local class serialVersionUID = -6895748366536402812
        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:699) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2001) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1848) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2158) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1665) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:501) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:459) ~[?:1.8.0_291]
        at java.util.HashMap.readObject(HashMap.java:1412) ~[?:1.8.0_291]
        at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_291]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_291]
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1185) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2294) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2185) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1665) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:501) ~[?:1.8.0_291]
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:459) ~[?:1.8.0_291]
        at com.netease.arctic.utils.SerializationUtil.simpleDeserialize(SerializationUtil.java:72) ~[amoro-core-0.6.0-SNAPSHOT.jar:?]
        ... 14 more
2023-09-14 15:29:19,316 ERROR [main] [com.netease.arctic.server.table.RuntimeHandlerChain] [] - failed to handle, ignore and continue
java.lang.NullPointerException: null
        at com.netease.arctic.server.DefaultOptimizingService$TableRuntimeHandlerImpl.doDispose(DefaultOptimizingService.java:359) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.table.RuntimeHandlerChain.doSilently(RuntimeHandlerChain.java:84) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.table.RuntimeHandlerChain.dispose(RuntimeHandlerChain.java:79) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.table.DefaultTableService.dispose(DefaultTableService.java:355) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.ArcticServiceContainer.dispose(ArcticServiceContainer.java:170) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]
        at com.netease.arctic.server.ArcticServiceContainer.main(ArcticServiceContainer.java:111) ~[amoro-ams-server-0.6.0-SNAPSHOT.jar:?]

Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant