From 4c376a3776aed0fb19b761406eaa2e0516ff6735 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 22 Feb 2014 15:58:03 -0500 Subject: Minimize race conditions in t_iprop.py Augment kpropd's debugging output so we can see the starting and ending serial numbers of a sync, and check them in t_iprop.py's wait_for_prop to make sure we're observing the correct sync each time. Try to make sure we only send SIGUSR1 when kpropd is actually sleeping, by waiting for it to print its pre-sleep message to stderr after a full dump and after each sync. This isn't perfect, as there is a short window between printing to stderr and actually sleeping, but we can't do any better until kpropd has a more reliable mechanism for triggering immediate updates. --- src/slave/kpropd.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/slave') diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index 55ca51159..0f4a8f000 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -781,8 +781,13 @@ reinit: * or (if needed) do a full resync of the krb5 db. */ - if (debug) - fprintf(stderr, _("Calling iprop_get_updates_1()\n")); + if (debug) { + fprintf(stderr, _("Calling iprop_get_updates_1 " + "(sno=%u sec=%u usec=%u)\n"), + (unsigned int)mylast.last_sno, + (unsigned int)mylast.last_time.seconds, + (unsigned int)mylast.last_time.useconds); + } gettimeofday(&iprop_start, NULL); incr_ret = iprop_get_updates_1(&mylast, handle->clnt); if (incr_ret == (kdb_incr_result_t *)NULL) { @@ -885,8 +890,11 @@ reinit: * the entries to the slave kdc database */ if (debug) { - fprintf(stderr, - _("Got incremental updates from the master\n")); + fprintf(stderr, _("Got incremental updates " + "(sno=%u sec=%u usec=%u)\n"), + (unsigned int)incr_ret->lastentry.last_sno, + (unsigned int)incr_ret->lastentry.last_time.seconds, + (unsigned int)incr_ret->lastentry.last_time.useconds); } retval = ulog_replay(kpropd_context, incr_ret, db_args); -- cgit