Skip to content

Commit 80c838a

Browse files
committed
Fix review points
1 parent e53de3b commit 80c838a

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ case object ContainerRemoved // when container is destroyed
5151
sealed trait ProxyState
5252
case object LeaseStart extends ProxyState
5353
case object Uninitialized extends ProxyState
54-
case object ContainerCreating extends ProxyState
54+
case object CreatingContainer extends ProxyState
5555
case object ContainerCreated extends ProxyState
56-
case object ClientCreating extends ProxyState
56+
case object CreatingClient extends ProxyState
5757
case object ClientCreated extends ProxyState
5858
case object Running extends ProxyState
5959
case object Pausing extends ProxyState

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/InvokerHealthyManager.scala

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,17 @@ class InvokerHealthManager(instanceId: InvokerInstanceId,
6262
InvokerHealthManager.prepare(entityStore, instanceId).map { _ =>
6363
startTestAction(self)
6464
}
65-
6665
goto(Unhealthy)
6766
}
6867

6968
when(Unhealthy) {
7069
case Event(ContainerRemoved, _) =>
7170
healthActionProxy = None
7271
startTestAction(self)
73-
7472
stay
7573

7674
case Event(msg: FailureMessage, _) =>
7775
logging.error(this, s"invoker${instanceId}, status:${stateName} got a failure message: ${msg}")
78-
7976
stay
8077

8178
case Event(ContainerCreationFailed(_), _) =>
@@ -92,6 +89,7 @@ class InvokerHealthManager(instanceId: InvokerInstanceId,
9289
case Event(_: Initialized, _) =>
9390
// Initialized messages sent by ContainerProxy for HealthManger
9491
stay()
92+
9593
case Event(ContainerRemoved, _) =>
9694
// Drop messages sent by ContainerProxy for HealthManger
9795
healthActionProxy = None
@@ -114,9 +112,7 @@ class InvokerHealthManager(instanceId: InvokerInstanceId,
114112
// in case of StatusRuntimeException: NOT_FOUND: etcdserver: requested lease not found, we need to get the lease again.
115113
case Event(t: FailureMessage, _) =>
116114
logging.error(this, s"Failure happens, restart InvokerHealthManager: ${t}")
117-
118115
goto(Offline)
119-
120116
}
121117

122118
// It is important to note that stateName and the stateData in onTransition callback refer to the previous one.
@@ -147,9 +143,7 @@ class InvokerHealthManager(instanceId: InvokerInstanceId,
147143

148144
case _ -> newState =>
149145
publishHealthStatusAndStay(newState, nextStateData)
150-
151146
unstashAll()
152-
153147
}
154148

155149
private def publishHealthStatusAndStay(state: InvokerState, stateData: InvokerHealthData) = {
@@ -162,14 +156,11 @@ class InvokerHealthManager(instanceId: InvokerInstanceId,
162156
data.memory.inProgressMemory,
163157
instanceId.tags,
164158
instanceId.dedicatedNamespaces)
165-
InvokerHealthManager.useMemory = invokerResourceMessage.busyMemory + invokerResourceMessage.inProgressMemory
166159
dataManagementService ! UpdateDataOnChange(InvokerKeys.health(instanceId), invokerResourceMessage.serialize)
167-
168160
stay using data.copy(currentInvokerResource = Some(invokerResourceMessage))
169161

170162
case data =>
171163
logging.error(this, s"unexpected data is found: $data")
172-
173164
stay
174165
}
175166
}
@@ -281,9 +272,6 @@ object InvokerHealthManager {
281272
val healthActionNamePrefix = "invokerHealthTestAction"
282273
val bufferSize = 10
283274
val bufferErrorTolerance = 3
284-
285-
var useMemory = 0l
286-
287275
val healthActionIdentity: Identity = {
288276
val whiskSystem = "whisk.system"
289277
val uuid = UUID()

0 commit comments

Comments
 (0)