elastic / elastic/apm-agent-nodejs

Question: Behavior of the Agent in AWS Lambda with `callbackWaitsForEmptyEventLoop` set to false?

Open
#2,643 1 comment 0 reactions 0 assignees View on GitHub
agent-nodejs
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.