jeremydaly / lambda-warmer

A module to optimize AWS Lambda function cold starts
MIT License
525 stars 55 forks source link

Warmer event randomly not detected in lambda #10

Closed robinth91 closed 4 weeks ago

robinth91 commented 5 years ago

One of our lambdas randomly doesn't detect the event as a warmer event and proceed further which breaks our code (it happens 2-5 times a day).

Our code looks like below:

module.exports.execute = async (event, context, callback) => {
  // Warming up the lambda.
  if (await warmer(event)) {
    console.log('Warming up the lambda');
    return;
  }

  // Other code
}

We use serverless to schedule the warmer.

- schedule:
    name: ${self:service}-${self:provider.region}-${self:provider.stage}-warmer-lambda
    rate: rate(5 minutes)
    enabled: ${self:custom.warmup.enabled.${self:custom.config.environment}}
    input:
      warmer: true
      concurrency: 3

Using atleast v3.5.0 of thelambda-warmer. node version 8.10.0

tanoabeleyra commented 4 years ago

The same started happening to me. Also, even if I scheduled the warmer to run every 5 minutes, it started triggering the Lambda every minute.

Given that I didn't need the concurrency feature, I just uninstalled this library and modified the condition to check event.warm.

naorpeled commented 4 weeks ago

Hey, sorry for the huge delay. As this is an issue from 5 years ago I assume this was already fixed by the newer versions of the library.

I'll be closing this issue but feel free to ping me and I'll happily re-open it.