From: Robert Varga Date: Mon, 4 Mar 2019 12:02:36 +0000 (+0100) Subject: Prevent a CME during actor instantiation X-Git-Tag: release/neon-sr1~33 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=1a181f5371db2ce55260a94cd379ff74007050f3;hp=99b2dc92f6a1991629d014c6d4a69df18269d627 Prevent a CME during actor instantiation This issue was missed in review: createHandler() should not be touching handlers, as it is already called from computeIfAbsent() and hence would result in a CME with JDK11: https://bugs.openjdk.java.net/browse/JDK-8206399 JIRA: CONTROLLER-1884 Change-Id: I8d4940b8bec2cf727d97d68796f1c9cdaaaf89d3 Signed-off-by: Robert Varga (cherry picked from commit 04107fb5efd9bd90809cb31897ec031bcb484df8) --- diff --git a/opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedFileJournal.java b/opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedFileJournal.java index a0bffa2c12..1dfcf4aef6 100644 --- a/opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedFileJournal.java +++ b/opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedFileJournal.java @@ -10,7 +10,6 @@ package org.opendaylight.controller.akka.segjournal; import static akka.actor.ActorRef.noSender; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import static com.google.common.base.Verify.verify; import akka.actor.ActorRef; import akka.dispatch.Futures; @@ -125,9 +124,6 @@ public class SegmentedFileJournal extends AsyncWriteJournal { final ActorRef handler = context().actorOf(SegmentedJournalActor.props(persistenceId, directory, storage, maxEntrySize, maxSegmentSize)); LOG.debug("Directory {} handled by {}", directory, handler); - - final ActorRef prev = handlers.putIfAbsent(persistenceId, handler); - verify(prev == null, "Duplicate handler for %s, already handled by %s", persistenceId, prev); return handler; }