2021-04-05 07:50:50 UTC - Keith Null: Hi all, I have read some code of 
OpenWhisk's `invoker` but am still confused about when an activation gets 
'ack'ed. Below are my current understandings, correct me if I make any mistakes:

First, an `invoker` subscribes to a Kafka topic (via a `MessageFeed` , which 
controls the maximum number of unacked messages as some form of back pressure). 
Then upon receiving some message sent to it from `controller` through that 
Kafka topic, the `inovker` simply forwards this message to its underlying 
`ContainerPool`  (via a `Run` message) to execute. The `ContainerPool` would 
then schedule containers if possible and let `ContainerProxy` actually dictate 
Docker to execute the message.

So here is my question: if the message gets executed successfully, how would it 
gets acked in `MessageFeed` ? I've noticed the `processBufferOrFeed()` function 
in `ContainPool` , in which a `Processed` message is sent to `MessageFeed`  as 
ack. But when will this function be invoked? I failed to find any explicit 
invocation of this function upon completion of messages. Instead, through 
simple search, I've found this function being invoked when `ContainerPool`  
receives `NeedWork(warmData: WarmedData)` or `ContainerRemoved(replacePrewarm)` 
messages from `ContainerProxy` , which looks really confusing to me.
https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1617609050095900?thread_ts=1617609050.095900&cid=C3TPCAQG1
----
2021-04-05 07:55:12 UTC - Keith Null: BTW, also some background for my purpose:

I'm trying to modify `invoker` to let it subscribe to multiple `MessageFeed` s, 
as a work-around solution to support priority queue with Kafka. But as I failed 
to figure out when messages are acked, I got stuck on when and which 
`MessageFeed` should I ack to apply back pressure properly and correctly.
https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1617609312099900?thread_ts=1617609312.099900&cid=C3TPCAQG1
----

Reply via email to