]
Dan Berindei updated ISPN-8954:
-------------------------------
Status: Resolved (was: Pull Request Sent)
Fix Version/s: 9.3.0.Final
Resolution: Done
StateReceiverImpl should request segments via an executor
---------------------------------------------------------
Key: ISPN-8954
URL:
https://issues.jboss.org/browse/ISPN-8954
Project: Infinispan
Issue Type: Bug
Components: Core
Affects Versions: 9.2.0.Final
Reporter: Ryan Emerson
Assignee: Ryan Emerson
Fix For: 9.3.0.Final, 9.2.1.Final
Currently when requesting segments an InboundTransferTask is executed in the thread
calling StateReceiver::getAllReplicasForSegment. The problem with this is that
InboundTransferTask::requestSegments is a blocking RPC call, which due to the
synchronization used by a SegmentRequest object means that it's not possible for a
segment request to be cancelled while an InboundTransferTask::requestSegment call is being
executed. Furthermore, this situation is exasperated by the fact that currently the
transfer tasks are created using the state transfer timeout (defualt is 4 mins), so
it's possible for the calling thread to be blocked for this amount of time.
The solution is to utilise the StateTransferExecutor to process the InboundTransferTasks
so that a segment request can be cancelled during a transfer request. Also, we should
utilise the remaining time of the DefaultConflictManager::ReplicaSpliterator as the upper
bound on the transfer tasks.