]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
unbound-dhcp-leases-bridge: Only wait if all events have been processed unbound-leases-fix
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Apr 2023 14:04:47 +0000 (16:04 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Apr 2023 14:04:47 +0000 (16:04 +0200)
This seems to solve a race condition where some hostnames where not
properly passed to unbound - probably if there were too many DHCP
updates in too short time.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/unbound/unbound-dhcp-leases-bridge

index 3f4f10a900c01f24d27004f9bdc01fe5685adcca..1c927474ae4619d67bfd5e8ccab5ca779298c06b 100644 (file)
@@ -116,6 +116,9 @@ class UnboundDHCPLeasesBridge(object):
                        for event in i.event_gen():
                                # Nothing to do
                                if event is None:
+                                       # Wait a moment before we start the next iteration
+                                       time.sleep(5)
+
                                        break
 
                                # Decode the event
@@ -143,9 +146,6 @@ class UnboundDHCPLeasesBridge(object):
                        # Reset
                        update_hosts = update_leases = False
 
-                       # Wait a moment before we start the next iteration
-                       time.sleep(5)
-
                log.info("Unbound DHCP Leases Bridge terminated")
 
        def update_dhcp_leases(self):