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-projects-issues opened this issue Feb 2, 2017 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues 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:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues 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-projects-issues
Copy link
Collaborator Author

spring-projects-issues 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-projects-issues
Copy link
Collaborator Author

spring-projects-issues 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
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants