azure-functions-host icon indicating copy to clipboard operation
azure-functions-host copied to clipboard

Introduce new app setting to control skipping null entries from event payload when sending to OOP layer

Open kshyju opened this issue 3 years ago • 2 comments

Background: For out-of-process functions, the host code gets the trigger data from the listener/processor module & then we convert the event data object to RPC invocation request instance which we will send to the out-of-process worker via GRPC. In the current implementation, we are skipping the empty entries in the ToRpcStringArray method which gets called internally inside ToRpcInvocationRequest method.

Empty-Entry-Skipped-ToRpc

This behavior causes confusion when dealing with batched event processing where the event body of one of the entries in the batch is null. The above screenshot is taken from an example where we are processing event hub messages(batched) where one of the message has null body, but the message still has valid meta properties. The oop worker will not be able to associate the meta properties of the message payload entries (message body) with the meta properties array. See this issue for a complete example.

Ask:

We need to introduce a new app setting, which when set to True, will skip the code which do the null check and discard codepath. Default value of this setting will be "False", so no existing apps are impacted.

kshyju avatar Jun 22 '22 19:06 kshyju

This would likely (ideally) be a capability advertised by the language worker as opposed to an app setting.

fabiocav avatar Jun 29 '22 20:06 fabiocav

@fabiocav: Is there any update on this? To me it looks like a small change, I can also try to contribute something but then it helps if I get some pointers where and how to change it.

wesselkranenborg avatar Jul 29 '22 10:07 wesselkranenborg