sentry-php: Fatal errors are not recorded with the curl method async
Sentry flushes the unsent messages and calls curl join in the onShutdown method, which is correctly registered to run on shutdown.
However, fatal errors are logged on the ErrorHandler shutdown callback, which is registered after onShutdown. (onShutdown is registered on the Client constructor, and error_handler->registerShutdownFunction is call after you build the Client).
The end result is that a Fatal error gets recorded internally, but it’s not send as onShutdown has already been called.
You need to make sure onShutdown runs after all other shutdown handlers.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (10 by maintainers)
Commits related to this issue
- fixes #391 Fatal errors are not recorded with the curl method async very inelegant, but if we call onShutdown() then error could be logged (if other logic allows it :) — committed to mfb/sentry-php by mfb 6 years ago
- Apply fix for #391: culprit was bad autoloading during fatal handling under PHP > 7 — committed to getsentry/sentry-php by Jean85 6 years ago
- Force event send after fatal error with curl_method async (#575) * Try to recreate a regression PHPT tests for async sending of fatal errors * Refactor PHPT regression test to check correctly for bu... — committed to getsentry/sentry-php by Jean85 6 years ago
- Apply final fix for #575 and #391 — committed to getsentry/sentry-php by Jean85 6 years ago
- Fix sending events async in PHP 5; add tests & fixes for #391 #575 (#576) * Improve regression test for #575 * Apply final fix for #575 and #391 * Refactor PHPT test to avoid triggering autoloader ... — committed to getsentry/sentry-php by Jean85 6 years ago
You’re right once again @mfb, thanks a lot for your help! You can check out the result in #576, I used your code to finally fix it! Does that work for you?