public function markFailed(WorkPackage $task, $log)
    {
        if ($this->logWorkerOutputOnFailure) {
            $this->updateTaskLog($task, $log);
        }
        $this->updateTaskStatus($task, Task::STATUS_FAILED);
        $this->beanstalk->delete($task->getPheanstalkJob());
    }