[ 
https://issues.apache.org/jira/browse/IGNITE-20161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17751508#comment-17751508
 ] 

Roman Puchkovskiy commented on IGNITE-20161:
--------------------------------------------

It seems that  this (and other) pools are nullified on join() because 2 tests 
in ItNodeTest (namely, the test that test bootstrap) are reusing NodeOptions 
objects: first such an object is used to bootstrap a node, then to init it. 
JRaft does not have NodeOptions inside BootstrapOptions at all; it seems that 
in our code it's added to share executors. But the intended way to share them 
is by using sharedPools = true which is not the case for the given tests. So it 
looks like the tests 'kinda share' the pools is another way deliberately. This 
looks weird and it's most likely not what was intended. That's the reason why I 
removed that 'sharing' in the 2 tests. This allows to remove the nullifying, 
which in turn makes the production code more robust (NPEs cannot happen 
anymore).

> Fix NPE in AppendEntriesRequestProcessor
> ----------------------------------------
>
>                 Key: IGNITE-20161
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20161
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Roman Puchkovskiy
>            Assignee: Roman Puchkovskiy
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> https://ci.ignite.apache.org/buildConfiguration/ApacheIgnite3xGradle_Test_RunAllTests/7408964?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildChangesSection=true&expandBuildProblemsSection=true&expandCode+Inspection=true
> 2023-08-03 11:57:25:040 +0300 
> [INFO][%int_tsdlttn_5005%JRaft-FSMCaller-Disruptor-_stripe_0-0][StateMachineAdapter]
>  onStartFollowing: LeaderChangeContext [leaderId=int_tsdlttn_5003, term=2, 
> status=Status[ENEWLEADER<10011>: Follower receives message from new leader 
> with the same term.]].
>   2023-08-03 11:57:25:040 +0300 
> [ERROR][%int_tsdlttn_5004%MessagingService-inbound--0][DefaultMessagingService]
>  onMessage() failed while processing InvokeRequestImpl [correlationId=4, 
> message=AppendEntriesRequestImpl [committedIndex=0, 
> data=org.apache.ignite.raft.jraft.util.ByteString@1, entriesList=null, 
> groupId=unitest, peerId=int_tsdlttn_5004, prevLogIndex=1, prevLogTerm=1, 
> serverId=int_tsdlttn_5003, term=2, timestampLong=110824852359479296]] from 
> int_tsdlttn_5003
>   java.lang.NullPointerException
>     at 
> org.apache.ignite.raft.jraft.rpc.impl.core.AppendEntriesRequestProcessor.getOrCreatePeerRequestContext(AppendEntriesRequestProcessor.java:351)
>     at 
> org.apache.ignite.raft.jraft.rpc.impl.core.AppendEntriesRequestProcessor$PeerExecutorSelector.select(AppendEntriesRequestProcessor.java:72)
>     at 
> org.apache.ignite.raft.jraft.rpc.impl.IgniteRpcServer$RpcMessageHandler.onReceived(IgniteRpcServer.java:182)
>     at 
> org.apache.ignite.network.DefaultMessagingService.onMessage(DefaultMessagingService.java:375)
>     at 
> org.apache.ignite.network.DefaultMessagingService.lambda$onMessage$4(DefaultMessagingService.java:335)
>     at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>     at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>     at java.base/java.lang.Thread.run(Thread.java:834)



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

Reply via email to