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

Also available in: Atom PDF