Skip to content

Commit 31741d1

Browse files
committed
Don't filter prewarmpool for other kinds
1 parent 0683808 commit 31741d1

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,9 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
134134
val kind = r.action.exec.kind
135135
val memory = r.action.limits.memory.megabytes.MB
136136

137-
val prewarmedPoolForOtherKind = prewarmedPool.filter { info =>
138-
info match {
139-
case (_, PreWarmedData(_, `kind`, `memory`, _, _)) => false
140-
case _ => true
141-
}
142-
}
143137
val createdContainer =
144138
// Is there enough space on the invoker for this action to be executed.
145-
if (hasPoolSpaceFor(busyPool ++ prewarmedPoolForOtherKind, memory)) {
139+
if (hasPoolSpaceFor(busyPool ++ prewarmedPool, memory)) {
146140
// Schedule a job to a warm container
147141
ContainerPool
148142
.schedule(r.action, r.msg.user.namespace.name, freePool)
@@ -151,7 +145,7 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
151145
// There was no warm/warming/warmingCold container. Try to take a prewarm container or a cold container.
152146

153147
// Is there enough space to create a new container or do other containers have to be removed?
154-
if (hasPoolSpaceFor(busyPool ++ freePool ++ prewarmedPoolForOtherKind, memory)) {
148+
if (hasPoolSpaceFor(busyPool ++ freePool ++ prewarmedPool, memory)) {
155149
takePrewarmContainer(r.action)
156150
.map(container => (container, "prewarmed"))
157151
.orElse {

0 commit comments

Comments
 (0)