openwhisk icon indicating copy to clipboard operation
openwhisk copied to clipboard

Create communication channel from invoker back to controller

Open perryibm opened this issue 10 years ago • 4 comments

Currently the controller polls cloudant for activation records which introduces extra DB operations (unnecessary load) and increased latency. The invoker should signal completion (along with the activation record if small) via low-latency kafka. This work depends on the integration of the load balancer into the controller. This channel will also give needed information for the load balancer to do its job better as it has a more live (timely) and refined (activation-specific) view of what's still running.

perryibm avatar Mar 30 '16 17:03 perryibm

+1 on sending activation completion messages over Kafka. I don't think we can get rid of Cloudant polling entirely though. It needs to be a fallback in case the controller dies before processing the message.

Also, I imagine you'd want the completion message to be directed to a particular controller rather than broadcast to all controllers.

vinodmut avatar Mar 31 '16 15:03 vinodmut

Yes, definitely to the specific originating controller using an instance topic as in the way it get to the invoker. I think of it as a completion mechanism which happens to carry the message. As such, I agree it will have to deal with a lack of ack if the invoker dies.

perryibm avatar Apr 04 '16 14:04 perryibm

A completion message is now sent back from the invoker to the controller and in a few test cases I have seen this happens faster than a cloudant poll as expected. The next step is to enhance the response with the activation result and for the controller to use this when available to complete a blocking call.

perryibm avatar May 26 '16 13:05 perryibm

The code implementing this has been reviewed, merged, and tested.

perryibm avatar Jul 29 '16 17:07 perryibm