sofastack / sofa-jraft

A production-grade java implementation of RAFT consensus algorithm.
https://www.sofastack.tech/projects/sofa-jraft/
Apache License 2.0
3.53k stars 1.12k forks source link

(fix) NullPointerException at FSMCallerImpl#doCommitted when this.node.getOptions() #1035 #1036

Closed tkalkirill closed 8 months ago

tkalkirill commented 8 months ago

(fix) NullPointerException at FSMCallerImpl#doCommitted when this.node.getOptions() #1035

Motivation:

I'm worried about the racing NullPointerException.

Modification:

Do the shutdown not outside but in the last task.

Result:

Fixes #1035.

If there is no issue then describe the changes introduced by this PR.

sofastack-cla[bot] commented 8 months ago

Hi @tkalkirill, welcome to SOFAStack community, Please sign Contributor License Agreement!

After you signed CLA, we will automatically sync the status of this pull request in 3 minutes.

tkalkirill commented 8 months ago

I tried to sign the CLA, but after that I couldn’t sign it again and on cla page I saw the message Thank you for signing the Agreement!.

Is there anything else that needs to be done or am I doing something wrong?

fengjiachun commented 8 months ago

Hi, welcome to contribute. Can you let me know which version of sofajraft you are using? It appears that I am unable to locate the code (FSMCallerImpl#doCommitted when this.node.getOptions()) where the NPE occurs in the latest code.

tkalkirill commented 8 months ago

Hi @fengjiachun, it’s hard for me to say which version exactly has this error, we made a fork from 1.3.5 and then copy the changes to version 1.3.10.

fengjiachun commented 8 months ago

@killme2008 PTAL

tkalkirill commented 8 months ago

@fengjiachun @killme2008 any update?

fengjiachun commented 8 months ago

@tkalkirill Thanks for your pull request. Initially, I was unsure about the accuracy of these changes. However, after meticulous review, it seems to be devoid of any issues.