From 9530f76af3a83d1decc57c4d66ac5524377ff935 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 27 Feb 2015 11:54:43 -0500 Subject: [PATCH] Avoid attempting to log negative client count If another bug causes client count to go negative, at least avoid sending that mistake to log, except as part of a trace log. --- confluent_server/confluent/consoleserver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/confluent_server/confluent/consoleserver.py b/confluent_server/confluent/consoleserver.py index 44a3fed5..2bc38aa4 100644 --- a/confluent_server/confluent/consoleserver.py +++ b/confluent_server/confluent/consoleserver.py @@ -304,6 +304,11 @@ class _ConsoleHandler(object): # clearly indicate redundant connections # not connection count edata = 2 + if edata < 0: + _tracelog.log('client count negative' + traceback.format_exc(), + ltype=log.DataTypes.event, + event=log.Events.stacktrace) + edata = 0 self.log( logdata=username, ltype=log.DataTypes.event, event=log.Events.clientconnect, eventdata=edata)