Add a bootstrapper to allow OOMs to be handled #430
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theBugsnag\Handler
class isn't used in Bugsnag LaravelThis can be used in conjunction with the new
memory_limit_increase
option (see bugsnag/bugsnag-php#621) to give Bugsnag enough headroom to send OOMsDesign
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'sThe 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 ApplicationChangeset
OomBootstrapper
class to allow handling OOMsmemory_limit_increase
option (see Allow Bugsnag\Handler to handle OOMs bugsnag-php#621)Testing