Skip to content

Commit

Permalink
Merge pull request #15160 from miodvallat/amnesia_got_me_in_trouble
Browse files Browse the repository at this point in the history
[pdnsutil] Better error message when disk full
  • Loading branch information
miodvallat authored Feb 14, 2025
2 parents f8e4a12 + 415a97c commit a8518b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,8 @@ static int increaseSerial(const DNSName& zone, DNSSECKeeper &dk)

auto rrs = vector<DNSResourceRecord>{rr};
if (!sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, rrs)) {
sd.db->abortTransaction();
cerr << "Backend did not replace SOA record. Backend might not support this operation." << endl;
sd.db->abortTransaction();
return -1;
}

Expand Down Expand Up @@ -997,7 +997,13 @@ static int deleteZone(const DNSName &zone) {
return EXIT_SUCCESS;
}
} catch (...) {
di.backend->abortTransaction();
try {
di.backend->abortTransaction();
} catch (...) {
// Ignore this exception (which is likely "cannot rollback - no
// transaction is active"), we have a more important one we want to
// rethrow.
}
throw;
}

Expand Down

0 comments on commit a8518b0

Please sign in to comment.