chetanmeh commented on a change in pull request #4326: Invoker backpressure
URL:
https://github.com/apache/incubator-openwhisk/pull/4326#discussion_r289343323
##########
File path:
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
##########
@@ -100,16 +124,20 @@ class ContainerPool(childFactory: ActorRefFactory =>
ActorRef,
// their requests and send them back to the pool for rescheduling (this
may happen if "docker" operations
// fail for example, or a container has aged and was destroying itself
when a new request was assigned)
case r: Run =>
+ implicit val tid: TransactionId = r.msg.transid
+ resent = resent - r.msg.activationId
// Check if the message is resent from the buffer. Only the first
message on the buffer can be resent.
val isResentFromBuffer = runBuffer.nonEmpty &&
runBuffer.dequeueOption.exists(_._1.msg == r.msg)
-
// Only process request, if there are no other requests waiting for free
slots, or if the current request is the
// next request to process
// It is guaranteed, that only the first message on the buffer is resent.
if (runBuffer.isEmpty || isResentFromBuffer) {
val createdContainer =
- // Is there enough space on the invoker for this action to be
executed.
- if (hasPoolSpaceFor(busyPool, r.action.limits.memory.megabytes.MB)) {
+ // Is there enough space on the invoker (or the cluster manager) for
this action to be executed.
+ if (poolConfig.clusterManagedResources || hasPoolSpaceFor(
Review comment:
For my understanding of flow here ... Prior to this change we did this pool
space check twice
1. At this point - Before even searching for any existing container with
assumption that new invocation means new container (probably for concurrent
usecase this logic should have been changed earlier itself?)
2. Later when no existing container was found and a new container is created
Now with cluster managed resource we would not be doing the first check at
all and instead only check for resources when a need arises for new container.
Which is fine but want to confirm if the interpretation is correct
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services