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

Add a bootstrapper to allow OOMs to be handled #430

Merged
merged 8 commits into from
Feb 10, 2021
Merged

Conversation

imjoehaines
Copy link
Contributor

Waiting on bugsnag/bugsnag-php#621 to be merged & released


Goal

This PR adds a new OomBootstrapper which can be used to enable Bugsnag Laravel to capture OOMs. The implementation is essentially the same as bugsnag/bugsnag-php#621, but has to use a slightly different mechanism as the Bugsnag\Handler class isn't used in Bugsnag Laravel

This can be used in conjunction with the new memory_limit_increase option (see bugsnag/bugsnag-php#621) to give Bugsnag enough headroom to send OOMs

Design

The new OomBootstrapper has to be registered manually by the developer as the first bootstrapper in their HTTP kernel. This is because Laravel's shutdown function will crash before our code is called if we register a shutdown function after Laravel's

The bootstrapper doesn't depend on anything that's Laravel specific, so Lumen apps can also use it by manually calling bootstrap before creating the Lumen Application

Changeset

Testing

  • Maze Runner tests that trigger OOMs added
  • Unit tests for config values
  • Manual testing against various Laravel/Lumen versions that are not covered in MR test matrix

@imjoehaines imjoehaines requested a review from kattrali February 1, 2021 13:50
@imjoehaines imjoehaines marked this pull request as ready for review February 10, 2021 09:46
@imjoehaines imjoehaines merged commit e9c78f7 into next Feb 10, 2021
@imjoehaines imjoehaines deleted the handle-ooms branch February 10, 2021 10:42
@imjoehaines imjoehaines mentioned this pull request Feb 10, 2021
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

Successfully merging this pull request may close these issues.

2 participants