Skip to content

Type-Zero/promise-timeout-hang-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Lambda Hanger

This creates a Lambda functions for testing if they will hang after a global timeout is triggered.

The amount of memory needed to be filled varies upon how much max memory there is but the problem seems to happen around the following:

  • 16% of a 128 MB to
  • 13% of a 1536 MB function.

To build and deploy:

./deploy.sh <s3_bucket_name>

To trigger the behavior set the event to a map: {"timeout": 6000}

Causing the hang

The function will stop responding if you invoke with a value that will cause a Lambda global timeout. Afterwards even if the event timeout is short enough, the function will not return again. If more memory is applied the function works again.

ARN=<function arn>

# Verify it is working
aws lambda invoke --function-name "${ARN}" --payload '{"timeout":1}' --query "LogResult" --log-type Tail --output text /dev/null | base64 -d

# Now break it
aws lambda invoke --function-name "${ARN}" --payload '{"timeout":6000}' --query "LogResult" --log-type Tail --output text /dev/null | base64 -d

#  Broken
aws lambda invoke --function-name "${ARN}" --payload '{"timeout":1}' --query "LogResult" --log-type Tail --output text /dev/null | base64 -d

Issues being tracked

Alternative examples

Background

About

Create hanging nodejs-lambda function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published