From 86488201d30eedf867c0b53fee1a1fa318d6ec37 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Mon, 14 Sep 2009 17:13:45 +0100
Subject: [PATCH] ganeti-confd: explicitely log failed big sends

Make sure that if we try to send packages which are too big (which
shouldn't happen) this gets properly logged in the config file.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>
---
 daemons/ganeti-confd | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/daemons/ganeti-confd b/daemons/ganeti-confd
index 7fb7239ed..f64c7965b 100755
--- a/daemons/ganeti-confd
+++ b/daemons/ganeti-confd
@@ -84,7 +84,10 @@ class ConfdAsyncUDPServer(daemon.AsyncUDPSocket):
     answer =  self.processor.ExecQuery(query, ip, port)
     if answer is not None:
       payload_out = ''.join([constants.CONFD_MAGIC_FOURCC, answer])
-      self.enqueue_send(ip, port, payload_out)
+      try:
+        self.enqueue_send(ip, port, payload_out)
+      except errors.UdpDataSizeError:
+        logging.error("Reply too big to fit in an udp packet.")
 
 
 class ConfdInotifyEventHandler(pyinotify.ProcessEvent):
-- 
GitLab