Describe the bug
On long running lambda instances, the Launch Darkly client appears to get stuck in a loop while trying to establish a connection. This loop continues until the lambda function times out, or runs out of memory.
To reproduce
This error only occurs intermittently, but is most common in the following circumstances:
- Have a long running AWS Lambda instance (greater than 45 minutes).
- Try to initialise the Launch Darkly client within a function on the lambda
- When initialising, the client gets stuck in a loop and outputs the following error until the function times out or runs out of memory.
ERROR warn: [LaunchDarkly] Received I/O error (getaddrinfo EMFILE stream.launchdarkly.com) for streaming request - will retry
- Subsequent calls to the function on the same lambda instance will successfully establish a Launch Darkly connection
Expected behavior
Ideally:
- The client is successfully able to establish a connection
However, an acceptable fall-back would be:
- If the client cannot establish a connection, a sensible error is thrown - rather than the function timing out.
Logs
The following log is repeated in the output until the Lambda function times out.
ERROR warn: [LaunchDarkly] Received I/O error (getaddrinfo EMFILE stream.launchdarkly.com) for streaming request - will retry
SDK version
launchdarkly-node-server-sdk v7.0.0
Language version, developer tools
AWS Lambda running nodejs:18.v4
OS/platform
AWS Lambda running nodejs:18.v4