Skip to content

Commit

Permalink
Resolve missing internal state update in EventSourcedRememberEntities… (
Browse files Browse the repository at this point in the history
  • Loading branch information
jneumaier committed May 4, 2021
1 parent 43d97e9 commit 73d74df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private[akka] final class EventSourcedRememberEntitiesShardStore(
left -= 1
if (left == 0) {
sender() ! RememberEntitiesShardStore.UpdateDone(started, stopped)
state.copy(state.entities.union(started).diff(stopped))
state = state.copy(state.entities.union(started).diff(stopped))
saveSnapshotWhenNeeded()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package akka.cluster.sharding.internal

import java.util.UUID

import akka.actor.Props
import akka.cluster.ddata.{ Replicator, ReplicatorSettings }
import akka.cluster.sharding.ClusterShardingSettings
Expand All @@ -17,17 +19,23 @@ import org.scalatest.wordspec.AnyWordSpecLike
* Covers the interaction between the shard and the remember entities store
*/
object RememberEntitiesShardStoreSpec {
def config = ConfigFactory.parseString("""
def config =
ConfigFactory.parseString(s"""
akka.loglevel=DEBUG
akka.loggers = ["akka.testkit.SilenceAllTestEventListener"]
akka.actor.provider = cluster
akka.remote.artery.canonical.port = 0
akka.remote.classic.netty.tcp.port = 0
akka.cluster.sharding.state-store-mode = ddata
akka.cluster.sharding.snapshot-after = 2
akka.cluster.sharding.remember-entities = on
# no leaks between test runs thank you
akka.cluster.sharding.distributed-data.durable.keys = []
akka.persistence.journal.plugin = "akka.persistence.journal.inmem"
akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot-store.local"
akka.persistence.snapshot-store.local.dir = "target/${classOf[RememberEntitiesShardStoreSpec].getName}-${UUID
.randomUUID()
.toString}"
""".stripMargin)
}

Expand Down

0 comments on commit 73d74df

Please sign in to comment.