Add a global timeout configuration using environment variable "func_timeout" for function handler call in POST
Populate more necessary information when errors occur
Motivation and Context
Since the call to handler is blocking, there is possibility that the function handler has some conditions that it will run for a longer time than expected or even forever (if any bug) and the ackWait could not solve this issue; thus we want to add a timeout wrapper and populate the information in the callback.
Also when err occurs, the functionResult is always empty, the callback api handler has no way to know the error details. What's more if several functions share the same X-Callback-Url, the callback api handler has no way to know which function failed since no information was populated. So we want to add error details and url information to the response.
How Has This Been Tested?
Set the func_timeout to a very small value and check the received response from callback api handler's log.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
Motivation and Context
How Has This Been Tested?
Set the func_timeout to a very small value and check the received response from callback api handler's log.
Types of changes
Checklist:
git commit -s