Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SettableListenableFuture may be successfully set with failureCallback executed and success callback ignored [SPR-15216] #19781

Closed
spring-issuemaster opened this issue Feb 2, 2017 · 3 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Feb 2, 2017

Ivan Sopov opened SPR-15216 and commented

Version that I tested is 4.3.7.BUILD-SNAPSHOT with the fix for #19766

I've checked fix for #19766 and it works. But I have wrote another test:

https://github.com/isopov/isopov-jcstress/blob/master/src/main/java/com/sopovs/moradanen/jcstress/spring/SettableListenableFuture2Test.java

It reveals that it is possible to successfully set value for this future, but success callback will not be executed and failure callback instead will be called. As in previous case it is the case of concurrently setting and cancelling future under race.


Affects: 4.3.6

Issue Links:

  • #19766 SettableListenableFuture may be both set and canceled successfully
  • #20731 SettableListenableFuture set has a race on Java6 (and old versions of Java7)
  • #19972 SettableListenableFuture setException is inconsistent with callbacks under race
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 2, 2017

Juergen Hoeller commented

Good catch! I've revised our SettableListenableFuture implementation once more, now centralizing all state into the inner FutureTask subclass (through overriding FutureTask.set and FutureTask.setException and bypassing FutureTask.run completely).

I'll ping you once this is available in a new 4.3.7 snapshot.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 2, 2017

Juergen Hoeller commented

A new 4.3.7.BUILD-SNAPSHOT containing this latest variant of SettableListenableFuture is available now. Please give it a try...

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 3, 2017

Ivan Sopov commented

Thanks, my jcstress-based tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.