Denis Chudov created IGNITE-23352:
-------------------------------------

             Summary: Eliminate races with storage cursors while handling 
replica messages
                 Key: IGNITE-23352
                 URL: https://issues.apache.org/jira/browse/IGNITE-23352
             Project: Ignite
          Issue Type: Bug
            Reporter: Denis Chudov


*Motivation*

Storage cursors are not thread safe by design. Meanwhile, some code in 
PartitionReplicaListener is written without awareness of that. For example, 
cursor can be closed by scan close request while it's still in use by another 
thread in a handler of retrieve batch request.

This can be solved, for example, by wrapping storage cursors with thread-safe 
decorator.

*Definition of done*

There are no possible races related to storage cursors in 
PartitionReplicaListener.

*Implementation notes*

It would be nice also to improve 
PartitionScanPublisher.PartitionScanSubscription#scanBatch: it should check 
#canceled flag on receiving retrieve batch response. Current implementation is 
correct but no actions are actually needed afte cancellation so they can be 
skipped.



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

Reply via email to