[ 
https://issues.apache.org/jira/browse/IGNITE-20160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Uttsel resolved IGNITE-20160.
------------------------------------
    Resolution: Duplicate

Fixed in https://issues.apache.org/jira/browse/IGNITE-20774

> NullPointerException in FSMCallerImpl.doCommitted
> -------------------------------------------------
>
>                 Key: IGNITE-20160
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20160
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 3.0.0-beta1
>            Reporter: Pavel Tupitsyn
>            Assignee: Sergey Uttsel
>            Priority: Blocker
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code:java}
> java.lang.NullPointerException
>     at 
> org.apache.ignite.raft.jraft.core.FSMCallerImpl.doCommitted(FSMCallerImpl.java:496)
>     at 
> org.apache.ignite.raft.jraft.core.FSMCallerImpl.runApplyTask(FSMCallerImpl.java:448)
>     at 
> org.apache.ignite.raft.jraft.core.FSMCallerImpl$ApplyTaskHandler.onEvent(FSMCallerImpl.java:136)
>     at 
> org.apache.ignite.raft.jraft.core.FSMCallerImpl$ApplyTaskHandler.onEvent(FSMCallerImpl.java:130)
>     at 
> org.apache.ignite.raft.jraft.disruptor.StripedDisruptor$StripeEntryHandler.onEvent(StripedDisruptor.java:226)
>     at 
> org.apache.ignite.raft.jraft.disruptor.StripedDisruptor$StripeEntryHandler.onEvent(StripedDisruptor.java:191)
>     at 
> com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:137)
> {code}
> [https://ci.ignite.apache.org/buildConfiguration/ApacheIgnite3xGradle_Test_IntegrationTests_ModuleRunnerSqlLogic/7410174?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildProblemsSection=true&expandBuildChangesSection=true]
> It happens here (see FSMCallerImpl#doCommitted):
> {code:java}
> final IteratorImpl iterImpl = new IteratorImpl(this.fsm, this.logManager, 
> closures, firstClosureIndex,
>     lastAppliedIndex, committedIndex, this.applyingIndex, 
> this.node.getOptions());{code}
> on the 2nd line, most likely on resolving null pointer to *node,* which is 
> nullified on FSMCaller shutdown. Raft groups were being stopped in this 
> moment.
> *Implementation details*
> A simple fix to avoid the NPE at the aforementioned line would be to check 
> `node` for null. 
> Additionally it would be nice to check `shutdownLatch` in `doCommitted` and 
> make sure we call `unsubscribe` in a proper order.
> The reason is that doCommitted is called from a disruptor's callback. 
> One more observation - the reference to a node is set to null in `shutdown` 
> that is called before `join` where we unsubscribe from notifications from 
> Disruptor. There is a little chance that something comes into FSMCallerImpl 
> after shutdown but before join.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to