Skip to content

Action scheduler breaks PHP error reporting and crashes the server #1255

Open
@kkmuffme

Description

@kkmuffme

When using a custom error handler (e.g. custom or Sentry), then all PHP errors reported by tasks in action scheduler except E_USER_ERROR | E_RECOVERABLE_ERROR will get "lost" (= end up in the PHP error log)

  1. this makes it much harder to keep track of things, since the PHP error log/log monitoring software provides much less useful data compared to e.g. Sentry
  2. we run woocommerce on lots of distributed servers that do not have much disk. If there are lots of tasks (or just a single hanging task Potential endless loop when processing actions in a claim #1245) that have a PHP error (e.g. simple case just an invalid preg_match() the PHP error log will quickly use all available disk (fastest I had was 7 minutes, on average a couple hours) which basically crashes the server

That happens bc https://github.com/woocommerce/action-scheduler/blob/dba9377f26daea2da114b33ddf1431a3550dfb3d/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php#L79C4-L79C38 restricts to 2 (parent) types of errors, which means all other errors will end up in PHP error log.

Kind of related to #1252

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions