summaryrefslogtreecommitdiffstats
path: root/src/slave
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2014-02-22 15:58:03 -0500
committerGreg Hudson <ghudson@mit.edu>2014-02-26 16:11:01 -0500
commit4c376a3776aed0fb19b761406eaa2e0516ff6735 (patch)
tree8fef68e444d89984c1eb33424d78fa604c29b29f /src/slave
parent8df1965d1ccdbcb8d74a3e68ad35d7579db9ac44 (diff)
downloadkrb5-4c376a3776aed0fb19b761406eaa2e0516ff6735.tar.gz
krb5-4c376a3776aed0fb19b761406eaa2e0516ff6735.tar.xz
krb5-4c376a3776aed0fb19b761406eaa2e0516ff6735.zip
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.
Diffstat (limited to 'src/slave')
-rw-r--r--src/slave/kpropd.c16
1 files changed, 12 insertions, 4 deletions
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);