Elevate unknown notifications to warnings, and filter out other syncs' messages.
authorGreg Sabino Mullane <greg@endpoint.com>
Sun, 26 Jun 2011 02:30:04 +0000 (22:30 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Sun, 26 Jun 2011 02:30:04 +0000 (22:30 -0400)
Bucardo.pm

index a064e43a6d902b9e2d0a2f7781bab4944775b769..8ffa7affd8adf6248371c203939f357ebad06225 100644 (file)
@@ -962,7 +962,7 @@ sub mcp_main {
 
             ## Should not happen, but let's at least log it
             else {
-                $self->glog("Received unknown message $name from $npid!", LOG_TERSE);
+                $self->glog("Warning: received unknown message $name from $npid!", LOG_TERSE);
             }
 
         } ## end each notice
@@ -1468,8 +1468,16 @@ sub start_controller {
                 next NOTICE;
             }
 
+            ## Someone else's sync is getting kicked, finishing up, or stopping
+            next NOTICE if
+                (index($name, 'kick_') == 0)
+                or
+                (index($name, 'syncdone_') == 0)
+                or
+                (index($name, 'stopsync_') == 0);
+
             ## Should not happen, but let's at least log it
-            $self->glog("Received unknown message $name from $npid!", LOG_TERSE);
+            $self->glog("Warning: received unknown message $name from $npid!", LOG_TERSE);
 
         } ## end of each notification
 
@@ -2279,9 +2287,19 @@ sub start_kid {
                     $self->db_notify($maindbh, "kid_${$}_pong");
                 }
 
+                ## Someone else's sync is running
+                elsif (index($name, 'run_') == 0) {
+                }
+                ## Someone else's sync is stopping
+                elsif (index($name, 'stopsync_') == 0) {
+                }
+                ## Someone else's kid is getting pinged
+                elsif (index($name, '_ping') > 0) {
+                }
+
                 ## Should not happen, but let's at least log it
                 else {
-                    $self->glog("Received unknown message $name from $npid!", LOG_TERSE);
+                    $self->glog("Warning: received unknown message $name from $npid!", LOG_TERSE);
                 }
 
             } ## end each notice