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
ISPN-11280 ConcurrentModificationException in ConditionFuture #7853
ISPN-11280 ConcurrentModificationException in ConditionFuture #7853
Conversation
core/src/main/java/org/infinispan/util/concurrent/ConditionFuture.java
Outdated
Show resolved
Hide resolved
0136e86
to
1055267
Compare
integrated! thanks @danberindei ! |
} | ||
|
||
public void stop() { | ||
running = false; | ||
lastValue = null; | ||
|
||
List<CompletableFuture<?>> completed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danberindei how about something like this to cut down on the sync scope?
final List<Data> copy;
synchronized (futures) {
copy = new ArrayList<>(futures.values());
futures.clear();
}
for (Data data : copy) {
data.cancelFuture.cancel(false);
}
data.completeExceptionally(e); | ||
} catch (Throwable t) { | ||
List<CompletableFuture<?>> completed; | ||
synchronized (futures) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same sync optimisation can be applied here too.
https://issues.redhat.com/browse/ISPN-11280
https://issues.redhat.com/browse/ISPN-11296