]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1147] Improved lost race comments
authorFrancis Dupont <fdupont@isc.org>
Thu, 21 May 2020 16:48:33 +0000 (18:48 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 26 May 2020 09:51:58 +0000 (11:51 +0200)
src/hooks/dhcp/lease_cmds/lease_cmds.cc

index e171385acbc15880af6b63f37f281f302c7fab74..20f9aa889830284708dc09367ec1c331c5e59379 100644 (file)
@@ -1175,7 +1175,8 @@ void updateOrAdd(Lease6Ptr lease) {
     } catch (const NoSuchLease& ex) {
         // Lease to be updated not found, so add it.
         if (!LeaseMgrFactory::instance().addLease(lease)) {
-            isc_throw(db::DuplicateEntry, "update then add lost race");
+            isc_throw(db::DuplicateEntry,
+                      "lost race between calls to update and add");
         }
     }
 }
@@ -1446,7 +1447,8 @@ namespace { // anonymous namepace.
 bool addOrUpdate4(Lease4Ptr lease, bool force_create) {
     if (force_create && !LeaseMgrFactory::instance().getLease4(lease->addr_)) {
         if (!LeaseMgrFactory::instance().addLease(lease)) {
-            isc_throw(db::DuplicateEntry, "get then add lost race");
+            isc_throw(db::DuplicateEntry,
+                      "lost race between calls to get and add");
         }
         return (true);
     }
@@ -1515,7 +1517,8 @@ bool addOrUpdate6(Lease6Ptr lease, bool force_create) {
     if (force_create &&
         !LeaseMgrFactory::instance().getLease6(lease->type_, lease->addr_)) {
         if (!LeaseMgrFactory::instance().addLease(lease)) {
-            isc_throw(db::DuplicateEntry, "get then add lost race");
+            isc_throw(db::DuplicateEntry,
+                      "lost race between calls to get and add");
         }
         return (true);
     }