Project

General

Profile

Actions

Bug #69157

closed

scheduler serializes complete exception on task failure

Added by Stephan Großberndt over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
Start date:
2015-08-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

If a task in scheduler fails it does not throw an exception but tries to log it to sys_log.

It logs the complete Exception by serializing it:

if ($failure instanceof \Exception) {
    // Log failed execution
    $logMessage = 'Task failed to execute successfully. Class: ' . get_class($this) . ', UID: ' . $this->taskUid . '. ' . $failure->getMessage();
    $this->scheduler->log($logMessage, 1, $failure->getCode());
    $failure = serialize($failure);
} else {
    $failure = '';
}
// Save the updated executions list
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . $this->taskUid, array(
    'serialized_executions' => $runningExecutionsSerialized,
    'lastexecution_failure' => $failure
));

This often leads to HUGE strings (I had one case with 53MB!!). If this exceeds mysqls max_allowed_packet (default 16MB) mysql kills the connection resulting in "mysql server has gone away"

Instead of serializing and logging the complete exception only relevant parts (all but Exception->getTrace) should be logged.


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #70105: Unsuccessful scheduler task execution results in "Serialization of 'Closure' is not allowed" errorClosed2015-09-25

Actions
Actions #1

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42717

Actions #2

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42717

Actions #3

Updated by Stephan Großberndt over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42736

Actions #5

Updated by Stephan Großberndt over 8 years ago

  • Status changed from Under Review to Resolved
Actions #6

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF