Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda /tmp directory not cleared before invocation reuse #78

Open
stormchasing opened this issue Nov 15, 2018 · 0 comments
Open

Lambda /tmp directory not cleared before invocation reuse #78

stormchasing opened this issue Nov 15, 2018 · 0 comments

Comments

@stormchasing
Copy link

When calling the lambda for hundreds of files at once I was getting failures due to lambda invocations that were running out of the available 640 MB. I raised the memory limit to 1024 MB and again saw out-of-memory failures. I eventually discovered this was due to files from previous lambda runs being left in the /tmp directory of a lambda that was being reused by AWS. I've temporarily solved this issue by emptying out the /tmp directory at the end of lambda_function.py just before the response is returned.
shutil.rmtree('/tmp', ignore_errors=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant