Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-5691

Remove SimpleCondition

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • None
    • None
    • None
    • Low

    Description

      Problematic scenario:
      1. two threads get blocked in SimpleCondition.await();
      2. some thread calls SimpleCondition.signal();
      3. one of blocked threads wakes up and runs;
      4. spurious wakeup happens in the second thread and it wakes up too and runs even though nobody signaled it.

      Thus this is a broken implementation of Condition interface.

      Anyway, looking at how code uses it, SimpleCondition can just be replaced with CountDownLatch.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ash2k Mikhail Mazursky Assign to me
            ash2k Mikhail Mazursky
            Mikhail Mazursky
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment