code: public function fail(JobInterface $job, array $options = [])
      {
          $envelope = $this->createEnvelope($job, $options);
          unset($envelope['created']);
          unset($envelope['scheduled']);
          $envelope['status'] = self::STATUS_FAILED;
  
          $this->mongoCollection->findOneAndUpdate(
              [
                  '_id' => new \MongoDB\BSON\ObjectId($job->getId())
              ],
              [
                  '$set' => $envelope
              ]
          );
      }
docs: Mark a job as permanent failed.
  
  The status will be set to self::STATUS_FAILED
  @param JobInterface $job
  @param array        $options unused