Skip to content

Commit d15bc22

Browse files
committed
Don't filter prewarmpool for other kinds
1 parent 7e1cdbf commit d15bc22

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

+2-8
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,9 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
128128
val kind = r.action.exec.kind
129129
val memory = r.action.limits.memory.megabytes.MB
130130

131-
val prewarmedPoolForOtherKind = prewarmedPool.filter { info =>
132-
info match {
133-
case (_, PreWarmedData(_, `kind`, `memory`, _, _)) => false
134-
case _ => true
135-
}
136-
}
137131
val createdContainer =
138132
// Is there enough space on the invoker for this action to be executed.
139-
if (hasPoolSpaceFor(busyPool ++ prewarmedPoolForOtherKind, memory)) {
133+
if (hasPoolSpaceFor(busyPool ++ prewarmedPool, memory)) {
140134
// Schedule a job to a warm container
141135
ContainerPool
142136
.schedule(r.action, r.msg.user.namespace.name, freePool)
@@ -145,7 +139,7 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
145139
// There was no warm/warming/warmingCold container. Try to take a prewarm container or a cold container.
146140

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

0 commit comments

Comments
 (0)