From 213d4400525f39ddcf64ef0d6150254c04d57ab2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 22 May 2020 13:55:24 -0400 Subject: [PATCH] Fix certificate watch In python3, it was not working. If another file got added, it could go with a busy loop. --- confluent_server/confluent/sockapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/sockapi.py b/confluent_server/confluent/sockapi.py index 6fe50770..2e827eb8 100644 --- a/confluent_server/confluent/sockapi.py +++ b/confluent_server/confluent/sockapi.py @@ -473,9 +473,10 @@ class SockApi(object): def watch_for_cert(self): libc = ctypes.CDLL(ctypes.util.find_library('c')) watcher = libc.inotify_init() - if libc.inotify_add_watch(watcher, '/etc/confluent/', 0x100) > -1: + if libc.inotify_add_watch(watcher, b'/etc/confluent/', 0x100) > -1: while True: select.select((watcher,), (), (), 86400) + os.read(watcher, 1024) if self.should_run_remoteapi(): os.close(watcher) self.start_remoteapi()