/**
  * Re-queue job that failed, or drop the job if it has failed
  * too many times
  *
  * @param Connection $conn
  */
 private function requeueError(Connection $conn)
 {
     if ($this->params['errorCount'] >= self::MAX_ERROR_RETRY) {
         LoggerFactory::getInstance('CirrusSearchChangeFailed')->warning("Dropping failing ElasticaWrite job for DataSender::{method} in cluster {cluster} after repeated failure", array('method' => $this->params['method'], 'cluster' => $conn->getClusterName()));
     } else {
         $delay = self::backoffDelay($this->params['errorCount']);
         $job = clone $this;
         $job->params['errorCount']++;
         $job->params['cluster'] = $conn->getClusterName();
         $job->setDelay($delay);
         // Individual failures should have already logged specific errors,
         LoggerFactory::getInstance('CirrusSearch')->info("ElasticaWrite job reported failure on cluster {cluster}. Requeueing job with delay of {delay}.", array('cluster' => $conn->getClusterName(), 'delay' => $delay));
         JobQueueGroup::singleton()->push($job);
     }
 }