Skip to content

Commit 4187f34

Browse files
committed
Don't filter prewarmpool for other kinds
1 parent 6b30317 commit 4187f34

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
@@ -137,15 +137,9 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
137137
val kind = r.action.exec.kind
138138
val memory = r.action.limits.memory.megabytes.MB
139139

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

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

0 commit comments

Comments
 (0)