elastic / elastic/apm-agent-nodejs
Question: Behavior of the Agent in AWS Lambda with `callbackWaitsForEmptyEventLoop` set to false?
- Dominant language
- JavaScript
- Stars
- 594
- Forks
- 244
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 16
Description
The AWS Lambda Context object has an obscure setting, [`callbackWaitsForEmptyEventLoop`](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/blob/e5d62346eb08f1723348197df70d4f55f9c2ebcf/src/Runtime/CallbackContext.ts#L116). Per [the docs](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html#:~:text=callbackWaitsForEmptyEventLoop)
> Set to false to send the response right away when the [callback](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html#nodejs-handler-sync) runs, instead of waiting for the Node.js event loop to be empty. If this is false, any outstanding events continue to run during the next invocation
It's unclear what the agent behavior will be with this set to false, or what effect (if any) this setting has on the freeze/thaw cycle.
This issue is intended as a place for folks who run into this issue to report problems, as well as a place for us to drop our own research into this setting as time allows.
Contributor guide
Assessment
This issue has not been assessed yet.