serverless / dashboard

MIT License
26 stars 10 forks source link

AWS Lambda SDK: Fix handling of not responding handler #775

Closed medikoo closed 1 year ago

medikoo commented 1 year ago

In the Node.js function handler does not have to be resolved (its callback called or returned promise resolved) for the invocation to successfully end.

In case of the drained event loop, AWS runtime will wrap up the invocation without waiting for the explicitly provided result.

In our logs, I've observed failures that describe a situation where we have a trace with two aws.lambda.invocation spans and not properly cleared tags after the previous invocation. As I tested its unresolved handler and drained the event loop, which may introduce such situations.

This patch fixes the handling of such scenario and issues a warning for the user, describing that such a situation occurred (cc @skierkowski)