struct ctdb_recovery_lock_handle *s =
(struct ctdb_recovery_lock_handle *) private_data;
+ s->locked = (status == '0') ;
+
+ /*
+ * If unsuccessful then ensure the process has exited and that
+ * the file descriptor event handler has been cancelled
+ */
+ if (! s->locked) {
+ TALLOC_FREE(s->h);
+ }
+
switch (status) {
case '0':
s->latency = latency;
break;
case '1':
- DEBUG(DEBUG_ERR,
- ("Unable to take recovery lock - contention\n"));
+ D_ERR("Unable to take recovery lock - contention\n");
+ break;
+
+ case '2':
+ D_ERR("Unable to take recovery lock - timeout\n");
break;
default:
- DEBUG(DEBUG_ERR, ("ERROR: when taking recovery lock\n"));
+ D_ERR("Unable to take recover lock - unknown error\n");
}
s->done = true;
- s->locked = (status == '0') ;
}
static void force_election(struct ctdb_recoverd *rec,