Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15409

SettableListenableFuture setException is inconsistent with callbacks under race

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.7
    • Fix Version/s: 4.3.8, 5.0 RC1
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      In continuation of SPR-15216 and SPR-15202 I decided to test setException method of SettableListenableFuture and received another portion of strange results.

      With methods set(value) and setException(new Exception()) executed under race following cases are possible:

      • Both methods return false but SuccessCallback is executed
      • Both methods return false but FailureCallback is executed

      I consider these cases as two flavors of the same problem - actually I expect that one of two methods will always return true.

      Jcstress-based tests may be found here:
      https://github.com/isopov/isopov-jcstress/blob/master/src/main/java/com/sopovs/moradanen/jcstress/spring/SettableListenableFuture3Test.java

      Also I tried to reproduce the problem without jcstress to better understand it and make sure that it lies not in my poor understanding of jcstress:
      https://github.com/isopov/isopov-jcstress/blob/master/src/main/java/com/sopovs/moradanen/jcstress/spring/SettableListenableFutureMain3Test.java
      This test does not reproduce the problem as reliably as jcstress-based one, but sometimes it still reproduces both flavors of the problem in the single run.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                isopov Ivan Sopov
                Last updater:
                St├ęphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 2 weeks, 5 days ago