141 ods_log_error(
"[%s[%i]] sign zone %s failed: %u RRsets failed",
146 ods_log_error(
"[%s[%i]] sign zone %s failed: processed %u of %u RRsets",
156 ods_log_debug(
"[%s[%i]] sign zone %s ok: %u of %u RRsets succeeded",
179 time_t never = (3600*24*365);
183 char* working_dir = NULL;
184 char* cfg_filename = NULL;
185 uint32_t tmpserial = 0;
205 switch (task->
what) {
226 goto task_perform_continue;
253 goto task_perform_fail;
255 goto task_perform_continue;
266 ods_log_debug(
"[%s[%i]] no valid signconf.xml for zone %s yet",
279 goto task_perform_fail;
281 goto task_perform_continue;
301 goto task_perform_fail;
303 goto task_perform_continue;
315 "failed to increment serial",
343 "signing zone %s, %u signatures queued",
352 status = worker_check_jobs(worker, task);
373 goto task_perform_fail;
375 goto task_perform_continue;
393 status =
tools_audit(zone, working_dir, cfg_filename);
394 if (working_dir) { free((
void*)working_dir); }
395 if (cfg_filename) { free((
void*)cfg_filename); }
405 goto task_perform_fail;
407 goto task_perform_continue;
424 goto task_perform_fail;
426 goto task_perform_continue;
511 if (task->
backoff > ODS_SE_MAX_BACKOFF) {
512 task->
backoff = ODS_SE_MAX_BACKOFF;
514 ods_log_info(
"[%s[%i]] backoff task %s for zone %s with %u seconds",
521 task_perform_continue:
545 time_t now, timeout = 1;
570 worker_perform_task(worker);
595 timeout = (worker->
task->
when - now);
599 if (timeout > ODS_SE_MAX_BACKOFF) {
600 timeout = ODS_SE_MAX_BACKOFF;
625 hsm_ctx_t* ctx = NULL;
658 ctx = hsm_create_context();
691 if (worker_fulfilled(chief) && chief->
sleeping) {
711 hsm_destroy_context(ctx);
725 switch (worker->
type) {
727 worker_drudge(worker);
769 while (!worker->
need_to_exit && !worker_fulfilled(worker)) {
774 ods_log_debug(
"[%s[%i]] somebody poked me, check completed jobs %u "
775 "appointed, %u completed, %u failed", worker2str(worker->
type),
895 cond_basic_type worker_cond;
#define lock_basic_off(cond)
const char * cfg_filename
#define LOCKED_WORKER_SIGN
task_type * schedule_get_first_task(schedule_type *schedule)
void ods_log_debug(const char *format,...)
lock_basic_type worker_lock
#define lock_basic_destroy(lock)
cond_basic_type q_threshold
#define LOCKED_WORKER_SLEEP
void * allocator_alloc(allocator_type *allocator, size_t size)
void lhsm_check_connection(void *engine)
#define LOCKED_WORKER_INIT
ods_status schedule_task(schedule_type *schedule, task_type *task, int log)
void ods_log_info(const char *format,...)
allocator_type * allocator
enum ods_enum_status ods_status
void worker_start(worker_type *worker)
lock_basic_type zone_lock
ods_status zone_backup(zone_type *zone)
ods_status zone_publish_dnskeys(zone_type *zone, int recover)
void ods_log_error(const char *format,...)
lock_basic_type stats_lock
const char * ods_status2str(ods_status status)
#define LOCKED_WORKER_DRUDGER(x)
ods_lookup_table * ods_lookup_by_id(ods_lookup_table *table, int id)
ods_status rrset_sign(hsm_ctx_t *ctx, rrset_type *rrset, ldns_rdf *owner, signconf_type *sc, time_t signtime, stats_type *stats)
#define LOCKED_SCHEDULE_WORKER(x)
void worker_cleanup(worker_type *worker)
void worker_wait_timeout_locked(lock_basic_type *lock, cond_basic_type *condition, time_t timeout)
#define lock_basic_set(cond)
enum task_id_enum task_id
struct engine_struct * engine
#define LOCKED_Q_DRUDGER(x)
ods_status zone_load_signconf(zone_type *zone, task_id *tbs)
void ods_log_crit(const char *format,...)
void worker_wait(lock_basic_type *lock, cond_basic_type *condition)
#define lock_basic_lock(lock)
engineconfig_type * config
#define LOCKED_SLEEP_DRUDGER(x)
void worker_sleep(worker_type *worker, time_t timeout)
#define lock_basic_sleep(cond, lock, sleep)
task_type * schedule_pop_task(schedule_type *schedule)
void worker_notify_all(lock_basic_type *lock, cond_basic_type *condition)
ods_status zone_update_serial(zone_type *zone)
#define LOCKED_WORKER_SLEEP_UNLESS
#define LOCKED_WORKER_WAKEUP
void worker_wakeup(worker_type *worker)
void fifoq_wipe(fifoq_type *q)
enum worker_enum worker_id
const char * task_what2str(int what)
void worker_sleep_unless(worker_type *worker, time_t timeout)
time_t duration2time(duration_type *duration)
const char * task_who2str(const char *who)
void ods_log_verbose(const char *format,...)
void worker_wait_locked(lock_basic_type *lock, cond_basic_type *condition)
#define lock_basic_init(lock)
ods_status zonedata_commit(zonedata_type *zd)
ods_status zone_prepare_keys(zone_type *zone)
duration_type * sig_resign_interval
cond_basic_type worker_alarm
void ods_log_deeebug(const char *format,...)
worker_type * worker_create(allocator_type *allocator, int num, worker_id type)
ods_status zone_prepare_nsec3(zone_type *zone, int recover)
void allocator_deallocate(allocator_type *allocator, void *data)
lock_basic_type schedule_lock
void worker_wait_timeout(lock_basic_type *lock, cond_basic_type *condition, time_t timeout)
#define ods_log_assert(x)
#define LOCKED_STATS_WORKER(x)
#define LOCKED_ZONE_WORKER(x)
#define lock_basic_alarm(cond)
#define lock_basic_unlock(lock)
void ods_log_warning(const char *format,...)
allocator_type * allocator
void worker_notify(lock_basic_type *lock, cond_basic_type *condition)
ods_status zonedata_queue(zonedata_type *zd, fifoq_type *q, worker_type *worker)
ods_lookup_table worker_str[]
#define lock_basic_broadcast(cond)
void * fifoq_pop(fifoq_type *q, worker_type **worker)