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

ISPN-11280 ConcurrentModificationException in ConditionFuture #7853

Merged
merged 2 commits into from Feb 14, 2020

Conversation

danberindei
Copy link
Member

@pruivo pruivo merged commit 35d5dec into infinispan:master Feb 14, 2020
@pruivo
Copy link
Member

pruivo commented Feb 14, 2020

integrated! thanks @danberindei !

}

public void stop() {
running = false;
lastValue = null;

List<CompletableFuture<?>> completed;
Copy link
Contributor

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) {
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants