This PR adds a new OomBootstrapper which can be used to enable Bugsnag Laravel to capture OOMs. The implementation is essentially the same as https://github.com/bugsnag/bugsnag-php/pull/621, but has to use a slightly different mechanism as the Bugsnag\Handler class isn't used in Bugsnag Laravel
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
Waiting on https://github.com/bugsnag/bugsnag-php/pull/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 https://github.com/bugsnag/bugsnag-php/pull/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 https://github.com/bugsnag/bugsnag-php/pull/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 https://github.com/bugsnag/bugsnag-php/pull/621)Testing