Skip to content

QueryIterator concurrency on close/cancelRequest #3755

Description

@afs

This is from #3753 (comment)

There is a race condition in QueryIterPlainWrapper and QueryIterAbortable which inherits from QueryIterPlainWrapper.

requestClose and close both call closeIterator but from different threads. closeIterator clears the iterator member.

Using synchronized on closeIterator and close should fix observed test failures (#3751).

However, these operations may cause internal state on the wrapped iterator.
hasNextBinding / moveToNextBinding / close (normal operation) will running on the query executiuon thread, so no concurrency issues,

But requestClose is called on a separate thread and it too may manipulate the internal state on the wrapped iterator.

This issue include review of QueryIterator cacnellation, not just QueryIterPlainWrapper.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions