[#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:
Thomas Markwalder
2025-12-06 17:05:53 -05:00
parent 85208ca6fe
commit e405e20595
3 changed files with 12 additions and 2 deletions

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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());
}
}