@@ -135,17 +135,17 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
135
135
.map(container => (container, container._2.initingState)) // warmed, warming, and warmingCold always know their state
136
136
.orElse(
137
137
// There was no warm/warming/warmingCold container. Try to take a prewarm container or a cold container.
138
-
139
- // Is there enough space to create a new container or do other containers have to be removed?
140
- if (hasPoolSpaceFor(busyPool ++ freePool ++ prewarmedPool, prewarmStartingPool, memory)) {
141
- takePrewarmContainer(r.action)
142
- .map(container => ( container, " prewarmed " ))
143
- .orElse {
138
+ // When take prewarm container, has no need to judge whether user memory is enough
139
+ takePrewarmContainer(r.action)
140
+ .map(container => (container, " prewarmed " ))
141
+ .orElse {
142
+ // Is there enough space to create a new container or do other containers have to be removed?
143
+ if (hasPoolSpaceFor(busyPool ++ freePool ++ prewarmedPool, prewarmStartingPool, memory)) {
144
144
val container = Some (createContainer(memory), " cold" )
145
145
incrementColdStartCount(kind, memory)
146
146
container
147
- }
148
- } else None )
147
+ } else None
148
+ } )
149
149
.orElse(
150
150
// Remove a container and create a new one for the given job
151
151
ContainerPool
@@ -444,7 +444,7 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
444
444
def hasPoolSpaceFor [A ](pool : Map [A , ContainerData ],
445
445
prewarmStartingPool : Map [A , (String , ByteSize )],
446
446
memory : ByteSize ): Boolean = {
447
- memoryConsumptionOf(pool) + + prewarmStartingPool.map(_._2._2.toMB).sum + memory.toMB <= poolConfig.userMemory.toMB
447
+ memoryConsumptionOf(pool) + prewarmStartingPool.map(_._2._2.toMB).sum + memory.toMB <= poolConfig.userMemory.toMB
448
448
}
449
449
450
450
/**
0 commit comments