138 time_t never = (3600*24*365);
142 char* working_dir = NULL;
143 char* cfg_filename = NULL;
144 uint32_t tmpserial = 0;
164 switch (task->
what) {
185 goto task_perform_continue;
212 goto task_perform_fail;
214 goto task_perform_continue;
225 ods_log_debug(
"[%s[%i]] no valid signconf.xml for zone %s yet",
238 goto task_perform_fail;
240 goto task_perform_continue;
260 goto task_perform_fail;
262 goto task_perform_continue;
274 "failed to increment serial",
296 "signing zone %s, %u signatures queued",
305 "signatures failed", worker2str(worker->
type),
309 }
else if (!worker_fulfilled(worker)) {
311 "signatures completed", worker2str(worker->
type),
317 "needs to exit", worker2str(worker->
type),
322 "signatures succeeded", worker2str(worker->
type),
345 goto task_perform_fail;
347 goto task_perform_continue;
365 status =
tools_audit(zone, working_dir, cfg_filename);
366 if (working_dir) { free((
void*)working_dir); }
367 if (cfg_filename) { free((
void*)cfg_filename); }
377 goto task_perform_fail;
379 goto task_perform_continue;
396 goto task_perform_fail;
398 goto task_perform_continue;
480 if (task->
backoff > ODS_SE_MAX_BACKOFF) {
481 task->
backoff = ODS_SE_MAX_BACKOFF;
486 ods_log_info(
"[%s[%i]] backoff task %s for zone %s with %u seconds",
493 task_perform_continue:
517 time_t now, timeout = 1;
541 worker_perform_task(worker);
570 timeout = (worker->
task->
when - now);
573 if (timeout > ODS_SE_MAX_BACKOFF) {
574 timeout = ODS_SE_MAX_BACKOFF;
598 hsm_ctx_t* ctx = NULL;
605 ctx = hsm_create_context();
624 if (chief && chief->
task) {
628 ods_log_error(
"[%s[%i]] unable to drudge: no zone reference",
653 if (worker_fulfilled(chief) && chief->
sleeping) {
682 hsm_destroy_context(ctx);
696 switch (worker->
type) {
698 worker_drudge(worker);
740 while (!worker->
need_to_exit && !worker_fulfilled(worker)) {
745 ods_log_debug(
"[%s[%i]] somebody poked me, check completed jobs %u "
746 "appointed, %u completed, %u failed", worker2str(worker->
type),
860 cond_basic_type worker_cond;