mirror of
https://gitlab.isc.org/isc-projects/kea.git
synced 2025-12-20 00:53:34 +08:00
[#4220] Addressed review comments
Changes to be committed:
new file: changelog_unreleased/4220-req-option-for-memfile-to-abort-daemon-on-error
modified: src/lib/dhcpsrv/memfile_lease_mgr.cc
modified: src/lib/util/csv_file.cc
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
[func] tmark
|
||||
Memfile lease back end now supports the ``on-fail``
|
||||
parameter though without retry. When set to either
|
||||
``stop-retry-exit`` or ``serve-retry-exit`` the
|
||||
server will exit on unrecoverable write errors. If
|
||||
set to ``serve-retry-continue`` the server will
|
||||
continue to run but write errors will continue until
|
||||
corrective action is taken. Applies to both
|
||||
kea-dhcp4 and kea-dhcp6.
|
||||
(Gitlab #4220)
|
||||
@@ -1158,7 +1158,7 @@ Memfile_LeaseMgr::addLeaseInternal(const Lease4Ptr& lease) {
|
||||
if (persistLeases(V4)) {
|
||||
try {
|
||||
lease_file4_->append(*lease);
|
||||
} catch (const CSVFileFatalError& ex) {
|
||||
} catch (const CSVFileFatalError&) {
|
||||
handleDbLost();
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,6 @@ CSVFile::append(const CSVRow& row) const {
|
||||
std::stringstream ss;
|
||||
ss << "failed to write CSV row '"
|
||||
<< text << "' to the file '" << filename_ << "'"
|
||||
<< " eof(): " << fs_->eof()
|
||||
<< " fail(): " << fs_->fail()
|
||||
<< " bad(): " << fs_->bad()
|
||||
<< " errno: " << sav_err
|
||||
@@ -202,6 +201,7 @@ CSVFile::append(const CSVRow& row) const {
|
||||
// No longer usable.
|
||||
isc_throw(CSVFileFatalError, ss.str());
|
||||
} else {
|
||||
fs_->clear();
|
||||
isc_throw(CSVFileError, ss.str());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user