[pve-devel] [PATCH manager] status/graphite: catch socket send errors

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 6 21:12:17 CET 2019


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

the catch: not really tested ^^

 PVE/Status/Graphite.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Status/Graphite.pm b/PVE/Status/Graphite.pm
index f43a49a7..b948526c 100644
--- a/PVE/Status/Graphite.pm
+++ b/PVE/Status/Graphite.pm
@@ -127,7 +127,7 @@ sub write_graphite {
 		write_graphite($carbon_socket, $value, $ctime, $path);
 	    } elsif ($value =~ m/^[+-]?[0-9]*\.?[0-9]+$/ &&
 		!$key_blacklist->{$key}) {
-		$carbon_socket->send( "$path $value $ctime\n" );
+		$carbon_socket->send( "$path $value $ctime\n" ) // die "graphite write to socket failed: $!\n";
 	    } else {
 		# do not send blacklisted or non-numeric values
 	    }
-- 
2.20.1





More information about the pve-devel mailing list