[
https://issues.apache.org/jira/browse/JENA-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13085373#comment-13085373
]
Stephen Allen commented on JENA-100:
------------------------------------
One of the potential issues caused by 3) is in the nextBinding() method on line
127:
It could be that a regular cancel was requested as we were midway through the
method (after checking the abortIterator, but before checking requestCancel).
This would cause the iterator to close and appear to terminate normally (but
without all of the results) instead of throwing a QueryCancelledException.
> QueryIteratorBase concurrency issues
> ------------------------------------
>
> Key: JENA-100
> URL: https://issues.apache.org/jira/browse/JENA-100
> Project: Jena
> Issue Type: Bug
> Components: ARQ
> Reporter: Stephen Allen
> Attachments: JENA-100-r1157891.patch
>
>
> QueryIteratorBase appears to have some concurrency bugs relating to
> cancelling a query:
> 1) The cancel() and cancelAllowContinue() methods did not have large enough
> synchronized blocks (they also used "this" as the lock, which is not
> recommended)
> 2) The order of setting the cancellation flags and the notifying subclasses
> via the requestCancel() method was incorrect
> 3) The visibility and happens-before relationships were incorrect for the
> requestingCancel and abortIterator variables
> The cancelAllowContinue() feature adds a lot of complexity in terms of
> visibility and ordering. Unfortunately it is hard to write test cases for
> these types of concurrency issues, so the existing tests did not uncover the
> issues.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira