From: Michal Rakowski Date: Tue, 26 Jan 2021 09:49:49 +0000 (+0100) Subject: Fix #7262 About adding MaximumJobErrorCount FileDaemon directive X-Git-Tag: Release-11.3.2~769 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2238ea70c1a432773ee2cd6c3c9c8af6daef5b08;p=thirdparty%2Fbacula.git Fix #7262 About adding MaximumJobErrorCount FileDaemon directive --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index b9ec0e63b..d5a58a8af 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -713,7 +713,7 @@ finish_sending: berrno be; Jmsg(jcr, M_ERROR, 0, _("Read error on file %s. ERR=%s\n"), bctx.ff_pkt->snap_fname, be.bstrerror(bctx.ff_pkt->bfd.berrno)); - if (jcr->JobErrors++ > 1000) { /* insanity check */ + if (jcr->JobErrors++ > me->max_job_errors) { /* insanity check */ Jmsg(jcr, M_FATAL, 0, _("Too many errors. JobErrors=%d.\n"), jcr->JobErrors); } } else if (bctx.ff_pkt->flags & FO_ENCRYPT) { diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index ec831559f..1720d4e74 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -117,6 +117,7 @@ static RES_ITEM cli_items[] = { {"MaximumBandwidthPerJob",store_speed, ITEM(res_client.max_bandwidth_per_job), 0, 0, 0}, {"CommCompression", store_bool, ITEM(res_client.comm_compression), 0, ITEM_DEFAULT, true}, {"DisableCommand", store_alist_str, ITEM(res_client.disable_cmds), 0, 0, 0}, + {"MaximumJobErrorCount", store_pint32, ITEM(res_client.max_job_errors), 0, ITEM_DEFAULT, 1000}, #if BEEF {"DedupIndexDirectory", store_dir, ITEM(res_client.dedup_index_dir), 0, 0, 0}, /* deprecated */ {"EnableClientRehydration", store_bool, ITEM(res_client.allow_dedup_cache), 0, ITEM_DEFAULT, false}, diff --git a/bacula/src/filed/filed_conf.h b/bacula/src/filed/filed_conf.h index ed410edcc..0d3e380e8 100644 --- a/bacula/src/filed/filed_conf.h +++ b/bacula/src/filed/filed_conf.h @@ -135,6 +135,7 @@ struct CLIENT { utime_t SDConnectTimeout; /* timeout in seconds */ utime_t heartbeat_interval; /* Interval to send heartbeats */ uint32_t max_network_buffer_size; /* max network buf size */ + uint32_t max_job_errors; /* Maximum number of errors tolerated by the client to fail the job */ bool comm_compression; /* Enable comm line compression */ bool pki_sign; /* Enable Data Integrity Verification via Digital Signatures */ bool pki_encrypt; /* Enable Data Encryption */