[Opendnssec-commits] matthijs r6951 - in trunk/OpenDNSSEC: . signer/doc signer/src/adapter signer/src/daemon signer/src/signer

commits at svn.opendnssec.org commits at svn.opendnssec.org
Wed Jan 16 14:39:13 CET 2013


Author: matthijs
Date: Wed Jan 16 14:39:12 2013
New Revision: 6951
URL: http://fisheye.opendnssec.org/changelog/opendnssec?cs=6951

Log:
bug reported by Ville Mattila

Modified:
   trunk/OpenDNSSEC/NEWS
   trunk/OpenDNSSEC/signer/doc/Changelog
   trunk/OpenDNSSEC/signer/src/adapter/addns.c
   trunk/OpenDNSSEC/signer/src/daemon/worker.c
   trunk/OpenDNSSEC/signer/src/signer/tools.c

Modified: trunk/OpenDNSSEC/NEWS
==============================================================================
--- trunk/OpenDNSSEC/NEWS	Wed Jan 16 12:26:19 2013	(r6950)
+++ trunk/OpenDNSSEC/NEWS	Wed Jan 16 14:39:12 2013	(r6951)
@@ -9,6 +9,8 @@
 Bugfixes:
 * SUPPORT-44: Signer Engine: Drop privileges after binding to socket
   [OPENDNSSEC-364].
+* Signer Engine: XFR not ready should not be a fatal status for task read
+  (thanks Ville Mattila).
 
 
 OpenDNSSEC 1.4.0rc1 - 2013-01-10

Modified: trunk/OpenDNSSEC/signer/doc/Changelog
==============================================================================
--- trunk/OpenDNSSEC/signer/doc/Changelog	Wed Jan 16 12:26:19 2013	(r6950)
+++ trunk/OpenDNSSEC/signer/doc/Changelog	Wed Jan 16 14:39:12 2013	(r6951)
@@ -1,3 +1,7 @@
+16 January 2012: Matthijs
+- Signer should not fail read task if there is no new xfr (thanks
+  Ville Mattila)
+
 10 January 2012: Matthijs
 - OPENDNSSEC-350: Improve logging when there are problems with inbound xfr
 - SUPPORT-44: bind() to sockets before privdrop

Modified: trunk/OpenDNSSEC/signer/src/adapter/addns.c
==============================================================================
--- trunk/OpenDNSSEC/signer/src/adapter/addns.c	Wed Jan 16 12:26:19 2013	(r6950)
+++ trunk/OpenDNSSEC/signer/src/adapter/addns.c	Wed Jan 16 14:39:12 2013	(r6951)
@@ -666,7 +666,10 @@
         z->xfrd->serial_disk_acquired <= z->xfrd->serial_xfr_acquired) {
         lock_basic_unlock(&z->xfrd->serial_lock);
         lock_basic_unlock(&z->xfrd->rw_lock);
-        return ODS_STATUS_XFR_NOT_READY;
+        if (!z->xfrd->serial_disk_acquired) {
+            return ODS_STATUS_XFR_NOT_READY;
+        }
+        return ODS_STATUS_UNCHANGED;
     }
     /* copy zone transfers */
     xfrfile = ods_build_path(z->name, ".xfrd", 0, 1);

Modified: trunk/OpenDNSSEC/signer/src/daemon/worker.c
==============================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/worker.c	Wed Jan 16 12:26:19 2013	(r6950)
+++ trunk/OpenDNSSEC/signer/src/daemon/worker.c	Wed Jan 16 14:39:12 2013	(r6951)
@@ -359,6 +359,11 @@
                     task->interrupt = TASK_NONE;
                     task->halted = TASK_NONE;
                 }
+            } else if (status == ODS_STATUS_UNCHANGED) {
+                ods_log_verbose("[%s[%i]] zone %s unsigned data not changed, "
+                    "continue", worker2str(worker->type), worker->thread_num,
+                    task_who2str(task));
+                status = ODS_STATUS_OK;
             } else {
                 if (task->halted == TASK_NONE) {
                     goto task_perform_fail;
@@ -521,9 +526,12 @@
     return;
 
 task_perform_fail:
-    ods_log_crit("[%s[%i]] CRITICAL: failed to sign zone %s: %s",
-        worker2str(worker->type), worker->thread_num,
-        task_who2str(task), ods_status2str(status));
+    if (status != ODS_STATUS_XFR_NOT_READY) {
+        /* other statuses is critical, and we know it is not ODS_STATUS_OK */
+        ods_log_crit("[%s[%i]] CRITICAL: failed to sign zone %s: %s",
+            worker2str(worker->type), worker->thread_num,
+            task_who2str(task), ods_status2str(status));
+    }
     /* in case of failure, also mark zone processed (for single run usage) */
     zone->db->is_processed = 1;
     if (task->backoff) {

Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
==============================================================================
--- trunk/OpenDNSSEC/signer/src/signer/tools.c	Wed Jan 16 12:26:19 2013	(r6950)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c	Wed Jan 16 14:39:12 2013	(r6951)
@@ -133,7 +133,7 @@
     /* Input Adapter */
     start = time(NULL);
     status = adapter_read((void*)zone);
-    if (status != ODS_STATUS_OK) {
+    if (status != ODS_STATUS_OK && status != ODS_STATUS_UNCHANGED) {
         ods_log_error("[%s] unable to read zone %s: adapter failed (%s)",
             tools_str, zone->name, ods_status2str(status));
         zone_rollback_dnskeys(zone);



More information about the Opendnssec-commits mailing list