From 40007a6a0778a2bf29bf06930a3ac3cfa73faefb Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 7 Mar 2016 16:43:34 -0500 Subject: [PATCH] Enable debug socket for sufficiently new eventlet Newer versions of eventlet address the bug in backdoor when used with unix domain sockets. Detect and take advantage of that circumstance. --- confluent_server/confluent/main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/confluent_server/confluent/main.py b/confluent_server/confluent/main.py index 07b54955..98c6655e 100644 --- a/confluent_server/confluent/main.py +++ b/confluent_server/confluent/main.py @@ -40,7 +40,10 @@ except ImportError: #only for now pass import eventlet -#import eventlet.backdoor as backdoor +dbgif = False +if map(int, (eventlet.__version__.split('.'))) > [0, 18]: + import eventlet.backdoor as backdoor + dbgif = True havefcntl = True try: import fcntl @@ -169,9 +172,10 @@ def run(): signal.signal(signal.SIGTERM, terminate) #TODO(jbjohnso): eventlet has a bug about unix domain sockets, this code #works with bugs fixed - #dbgsock = eventlet.listen("/var/run/confluent/dbg.sock", - # family=socket.AF_UNIX) - #eventlet.spawn_n(backdoor.backdoor_server, dbgsock) + if dbgif: + dbgsock = eventlet.listen("/var/run/confluent/dbg.sock", + family=socket.AF_UNIX) + eventlet.spawn_n(backdoor.backdoor_server, dbgsock) http_bind_host, http_bind_port = _get_connector_config('http') sock_bind_host, sock_bind_port = _get_connector_config('socket') consoleserver.start_console_sessions()