Fix state.nonEmpty check when starting HandOffStopper#27647 (#27860)
* Shard state.entities and idByRef properties incosistency in case of HandOffStopper creation * Additional sharding debugging logs (cherry picked from commit 70c2b571b9759e0441529fe107b8e8bf42825415)
This commit is contained in:
parent
bd724e85f5
commit
0e34d3490d
2 changed files with 7 additions and 4 deletions
|
|
@ -359,8 +359,9 @@ private[akka] class Shard(
|
||||||
case None =>
|
case None =>
|
||||||
log.debug("HandOff shard [{}]", shardId)
|
log.debug("HandOff shard [{}]", shardId)
|
||||||
|
|
||||||
if (state.entities.nonEmpty) {
|
if (idByRef.nonEmpty) {
|
||||||
val entityHandOffTimeout = (settings.tuningParameters.handOffTimeout - 5.seconds).max(1.seconds)
|
val entityHandOffTimeout = (settings.tuningParameters.handOffTimeout - 5.seconds).max(1.seconds)
|
||||||
|
log.debug("Starting HandOffStopper for shard [{}] to terminate [{}] entities.", shardId, idByRef.keySet.size)
|
||||||
handOffStopper = Some(
|
handOffStopper = Some(
|
||||||
context.watch(context.actorOf(
|
context.watch(context.actorOf(
|
||||||
handOffStopperProps(shardId, replyTo, idByRef.keySet, handOffStopMessage, entityHandOffTimeout))))
|
handOffStopperProps(shardId, replyTo, idByRef.keySet, handOffStopMessage, entityHandOffTimeout))))
|
||||||
|
|
|
||||||
|
|
@ -439,10 +439,12 @@ object ShardRegion {
|
||||||
def receive: Receive = {
|
def receive: Receive = {
|
||||||
case ReceiveTimeout =>
|
case ReceiveTimeout =>
|
||||||
log.warning(
|
log.warning(
|
||||||
"HandOffStopMessage[{}] is not handled by some of the entities of the `{}` shard, " +
|
"HandOffStopMessage[{}] is not handled by some of the entities of the [{}] shard after [{}], " +
|
||||||
"stopping the remaining entities.",
|
"stopping the remaining [{}] entities.",
|
||||||
stopMessage.getClass.getName,
|
stopMessage.getClass.getName,
|
||||||
shard)
|
shard,
|
||||||
|
handoffTimeout.toCoarsest,
|
||||||
|
remaining.size)
|
||||||
|
|
||||||
remaining.foreach { ref =>
|
remaining.foreach { ref =>
|
||||||
context.stop(ref)
|
context.stop(ref)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue