Quieter logging for ShardCoordinator initialization (#30488)
* Log the first retry on 'info', then 'warning', and finally 'error'
This commit is contained in:
parent
6b71804de3
commit
51924f5026
1 changed files with 11 additions and 4 deletions
|
|
@ -1432,6 +1432,7 @@ private[akka] class DDataShardCoordinator(
|
||||||
|
|
||||||
private var terminating = false
|
private var terminating = false
|
||||||
private var getShardHomeRequests: Set[(ActorRef, GetShardHome)] = Set.empty
|
private var getShardHomeRequests: Set[(ActorRef, GetShardHome)] = Set.empty
|
||||||
|
private var initialStateRetries = 0
|
||||||
|
|
||||||
private val rememberEntitiesStore =
|
private val rememberEntitiesStore =
|
||||||
rememberEntitiesStoreProvider.map { provider =>
|
rememberEntitiesStoreProvider.map { provider =>
|
||||||
|
|
@ -1468,10 +1469,16 @@ private[akka] class DDataShardCoordinator(
|
||||||
onInitialState(existingState, rememberedShards)
|
onInitialState(existingState, rememberedShards)
|
||||||
|
|
||||||
case GetFailure(CoordinatorStateKey, _) =>
|
case GetFailure(CoordinatorStateKey, _) =>
|
||||||
log.error(
|
initialStateRetries += 1
|
||||||
"{}: The ShardCoordinator was unable to get an initial state within 'waiting-for-state-timeout': {} millis (retrying). Has ClusterSharding been started on all nodes?",
|
val template =
|
||||||
typeName,
|
"{}: The ShardCoordinator was unable to get an initial state within 'waiting-for-state-timeout': {} millis (retrying). Has ClusterSharding been started on all nodes?"
|
||||||
stateReadConsistency.timeout.toMillis)
|
if (initialStateRetries == 1)
|
||||||
|
log.info(template, typeName, stateReadConsistency.timeout.toMillis)
|
||||||
|
else if (initialStateRetries < 5)
|
||||||
|
log.warning(template, typeName, stateReadConsistency.timeout.toMillis)
|
||||||
|
else
|
||||||
|
log.error(template, typeName, stateReadConsistency.timeout.toMillis)
|
||||||
|
|
||||||
// repeat until GetSuccess
|
// repeat until GetSuccess
|
||||||
getCoordinatorState()
|
getCoordinatorState()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue