]> granicus.if.org Git - icinga2/commitdiff
cluster: Fix log replay.
authorGunnar Beutner <gunnar@beutner.name>
Thu, 19 Sep 2013 13:08:34 +0000 (15:08 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 19 Sep 2013 13:08:34 +0000 (15:08 +0200)
components/cluster/clustercomponent.cpp

index 0e9e0a1b04cafc59ae94147ba35bb85995a6c317..ed777386f461650436f6a1d5c4cc4037c35995e5 100644 (file)
@@ -438,6 +438,8 @@ void ClusterComponent::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Pt
                                        if (!NetString::ReadStringFromStream(lstream, &message))
                                                break;
                                } catch (std::exception&) {
+                                       Log(LogWarning, "cluster", "Unexpected end-of-file for cluster log: " + path);
+
                                        /* Log files may be incomplete or corrupted. This is perfectly OK. */
                                        break;
                                }
@@ -460,7 +462,7 @@ void ClusterComponent::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Pt
 
                                        if (!dtype) {
                                                Log(LogWarning, "cluster", "Invalid type in security attribute: " + type);
-                                               return;
+                                               continue;
                                        }
 
                                        String name = security->Get("name");
@@ -468,7 +470,7 @@ void ClusterComponent::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Pt
 
                                        if (!secobj) {
                                                Log(LogWarning, "cluster", "Invalid object name in security attribute: " + name + " (of type '" + type + "')");
-                                               return;
+                                               continue;
                                        }
 
                                        privs = security->Get("privs");