From: Greg Hudson Date: Wed, 8 Apr 2015 21:23:25 +0000 (-0400) Subject: In kpropd, poll after finishing resync X-Git-Tag: krb5-1.14-alpha1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c19fee0a748dd26ba6ac62118cf4b9ebec36ba2f;p=thirdparty%2Fkrb5.git In kpropd, poll after finishing resync 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 --- diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index 18a8e1d2cf..1bac58e2a1 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -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); } diff --git a/src/tests/t_iprop.py b/src/tests/t_iprop.py index aece8c2d47..78938fc5eb 100755 --- a/src/tests/t_iprop.py +++ b/src/tests/t_iprop.py @@ -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: