From 9e44087047f322f20bdb6dcb2c3c94caf4d70595 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 28 Jul 2017 15:53:07 -0400 Subject: [PATCH] Breakup logentries exceeding 65k The data length of a log entry must not exceed 65k. If an attempt is made to log that much, break it up and duplicate the records. It may make sense to indicate a continuation explicitly, but for now just extend. --- .../plugins/hardwaremanagement/ipmi.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 55dd3997..2f6b6da2 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -31,8 +31,25 @@ console = eventlet.import_patched('pyghmi.ipmi.console') ipmicommand = eventlet.import_patched('pyghmi.ipmi.command') import socket + +# There is something not right with the RLocks used in pyghmi when +# eventlet comes into play. It seems like sometimes on acquire, +# it calls _get_ident and it isn't the id(greenlet) and so +# a thread deadlocks itself due to identity crisis? +# However, since we are not really threaded, the operations being protected +# are not actually dangerously multiplexed... so we can replace with +# a null context manager for now +class NullLock(object): + def __enter__(self, *args, **kwargs): + return 1 + + def __exit__(self, *args, **kwargs): + return 1 + console.session.select = eventlet.green.select console.session.threading = eventlet.green.threading +console.session.WAITING_SESSIONS = NullLock() +console.session.KEEPALIVE_SESSIONS = NullLock() console.session.socket.getaddrinfo = eventlet.support.greendns.getaddrinfo