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

fix: Explicitly exit when container is out-of-memory #6476

Merged
merged 9 commits into from
Jan 4, 2024

Conversation

mildaniel
Copy link
Contributor

@mildaniel mildaniel commented Dec 20, 2023

Which issue(s) does this change fix?

#6260

Why is this change necessary?

When an invoke container exits because it's out of memory, SAM CLI doesn't communicate this to customers and it's unclear why the invocation failed.

How does it address the issue?

Explicitly note the exit reason is out-of-memory and exit with return code 1 instead of 0.

What side effects does this change have?

Existing invocations that fail due to out-of-memory will return exit code 1.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • [] Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


state = self.container_manager.inspect(self.container.id)

if isinstance(state, bool):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is admittedly a little weird, but mypy won't like it if we don't do this, and the reason we return a bool here is to follow the legacy pattern in container_manager.

@mildaniel mildaniel marked this pull request as ready for review January 2, 2024 19:27
@mildaniel mildaniel requested a review from a team as a code owner January 2, 2024 19:27
@mildaniel mildaniel requested review from lucashuy and sidhujus January 2, 2024 19:27
@mildaniel mildaniel changed the title Out of memory fix: Explicitly exit when container is out-of-memory Jan 2, 2024
@mildaniel mildaniel added this pull request to the merge queue Jan 4, 2024
Merged via the queue into aws:develop with commit e03f145 Jan 4, 2024
55 checks passed
@mildaniel mildaniel deleted the out-of-memory branch January 4, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants