]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
In kpropd, poll after finishing resync
authorGreg Hudson <ghudson@mit.edu>
Wed, 8 Apr 2015 21:23:25 +0000 (17:23 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 13 Apr 2015 21:48:03 +0000 (17:48 -0400)
When kpropd operates in iprop mode, full resyncs are handled by a
child process.  After a full resync, we want to poll for incremental
updates, as the dump we received may have come from a pre-existing
dump file which was not current.  To make this polling happen
promptly, signal the parent process from the child process after a
dump is received.

With this change, t_iprop.py no longer has to prod kpropd after a full
resync occurs, so remove that logic.

ticket: 8161

src/slave/kpropd.c
src/tests/t_iprop.py

index 18a8e1d2cfe54e18c3649a05c6961cf990a82fc3..1bac58e2a1a97a72bef42d13d7f86bccb0dd472e 100644 (file)
@@ -298,7 +298,7 @@ main(int argc, char **argv)
     /*
      * This is the iprop case.  We'll fork a child to run do_standalone().  The
      * parent will run do_iprop().  We try to kill the child if we get killed.
-     * Catch SIGUSR1 so tests can use it to interrupt the sleep timer and force
+     * Catch SIGUSR1, which can be used to interrupt the sleep timer and force
      * an iprop request.
      */
     signal_wrapper(SIGHUP, kill_do_standalone);
@@ -440,6 +440,10 @@ do_standalone()
 
             close(s);
 
+            /* If we are the fullprop child in iprop mode, notify the parent
+             * process that it should poll for incremental updates. */
+            if (fullprop_child == 0)
+                kill(getppid(), SIGUSR1);
             if (runonce)
                 exit(0);
         }
index aece8c2d47ce27610121b5adabd59c582c214e20..78938fc5ebd984932088e607090529b13099122c 100755 (executable)
@@ -10,7 +10,7 @@ from k5test import *
 # versa.
 def wait_for_prop(kpropd, full_expected, expected_old, expected_new):
     output('*** Waiting for sync from kpropd\n')
-    full_seen = sleep_seen = prodded_after_dump = False
+    full_seen = sleep_seen = False
     old_sno = new_sno = -1
     while True:
         line = kpropd.stdout.readline()
@@ -39,12 +39,6 @@ def wait_for_prop(kpropd, full_expected, expected_old, expected_new):
             sleep_seen = True
         if 'load process for full propagation completed' in line:
             full_seen = True
-        if sleep_seen and full_seen and not prodded_after_dump:
-            # Prod the kpropd parent into getting incrementals after
-            # it finishes a DB load.  This will be unnecessary if
-            # kpropd is simplified to use a single process.
-            kpropd.send_signal(signal.SIGUSR1)
-            prodded_after_dump = True
 
         # Detect some failure conditions.
         if 'Still waiting for full resync' in line: