Review main Merged

84152[BUGFIX] Add scheduler task exception to error message

Christian Weiske CR +2 V +2 Easy +7 −3 updated 06/20/24, 18:54

Commit message

When a scheduler task throws an exception, an error is logged.
The log message does not tell us the reason for the failure:
> Task failed to execute successfully.
> Class: TYPO3\CMS\Scheduler\Task\ExecuteSchedulableCommandTask, UID: 2

Up to TYPO3 v10, this message did include more information:
> Task failed to execute successfully.
> Class: TYPO3\CMS\Scheduler\Task\ExecuteSchedulableCommandTask, UID: 2,
> Code: 56, OpenSSL SSL_read: Connection reset by peer, errno 104

This behavior was changed (probably unintentional) with patch
"[BUGFIX] Make logger usage PSR-3 compliant"
https://review.typo3.org/c/Packages/TYPO3.CMS/+/69425

Besides the task class and UID, the log message now contains the
exception code, message, file and line.

Example:
> Task failed to execute successfully.
> Class: TYPO3\CMS\Scheduler\Task\ExecuteSchedulableCommandTask, UID: 6,
> Code: 500, "FailTask fail message"
> in /var/www/typo3/vendor/[...]/Classes/Command/FailTask.php#19

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1924

  1. Christian Weiske uploaded patch set 1 05/07/24, 11:55

  2. core-ci voted on patch set 1 V +1 05/07/24, 12:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57332

  3. Benni Mack voted on patch set 1 CR +1 V +1 05/07/24, 15:17

  4. Nikita Hovratov voted on patch set 1 CR +1 05/07/24, 15:28

  5. Christoph Lehmann commented on patch set 1 05/08/24, 12:26

    Scheduler.php:173

    The Exceptions file and line should also logged
  6. Christoph Lehmann commented on patch set 1 05/08/24, 12:31

    Scheduler.php:173 Reply

    (and the exception class)
  7. Andreas Kienast commented on patch set 1 05/08/24, 14:24

    Scheduler.php:173 Reply

    File and class are interchangeable, but logging the class is easier.
  8. Christian Weiske uploaded patch set 2 CR +1 V +1 06/10/24, 12:01

  9. core-ci voted on patch set 2 V +1 06/10/24, 12:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59002

  10. Christian Weiske commented on patch set 2 06/13/24, 11:50

    The file name and line is included now, but not the class name. Not every crash is guranteed to have a class as a source.

    Scheduler.php:173 Reply

    Done
  11. Christoph Lehmann commented on patch set 3 V +1 06/15/24, 21:39

    Published edit on patch set 2.
  12. core-ci voted on patch set 3 V +1 06/15/24, 21:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59660

  13. Benni Mack voted on patch set 3 CR +1 06/19/24, 20:49

  14. Georg Ringer voted on patch set 3 CR +1 V +1 06/20/24, 06:08

  15. Christian Kuhn commented on patch set 3 06/20/24, 16:17

    hmpf. another regression we introduced with that logging patch :/ thanks for fixing! patch looks good, i just would like to remove v11 from the list for two reasons: * not a critical bug fix * does not apply cleanly in v11 since we rewrote so much scheduler code in v12
  16. Christian Kuhn updated the commit message in patch set 4 CR +1 V +1 06/20/24, 16:17

  17. Christian Kuhn rebased onto patch set 5 06/20/24, 16:17

  18. Christian Kuhn voted on patch set 5 CR +1 V +1 06/20/24, 16:17

  19. core-ci voted on patch set 4 V +1 06/20/24, 16:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59930

  20. core-ci voted on patch set 5 V +1 06/20/24, 16:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59931

  21. Stefan Bürk voted on patch set 5 CR +1 V +1 06/20/24, 16:58

  22. Christian Kuhn voted on patch set 5 CR +2 V +2 06/20/24, 17:03

  23. Georg Ringer voted on patch set 5 CR +1 V +1 06/20/24, 18:50

  24. Christian Kuhn merged patch set 6 06/20/24, 18:54