Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8229441

Add AQS tests with self-interrupting try-acquire methods

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      j.u.c. tests have seen (very rare) racy occurrences of AQS-based synchronizers being interrupted while a blocking method is running, in particular while a try-acquire method is running.

      We should test such scenarios systematically, by creating variants of test-only synchronizers like BooleanLatch which can be provoked to self-interrupt in methods like tryAcquireShared. Then if the tryAcquire method succeeds, the enclosing blocking method (e.g. await) should return preserving the interrupt, while if it fails, the method should surely throw InterruptedException.

        Attachments

          Activity

            People

            • Assignee:
              martin Martin Buchholz
              Reporter:
              martin Martin Buchholz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: