Actions
Bug #69157
closedscheduler serializes complete exception on task failure
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.
Actions