From a8cd9a24d576f9f1bdc1a6438c4fb4f3d1e7a461 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 2 Jul 2026 12:13:24 -0400 Subject: [PATCH] Auto-restart vtbufferd on exit If vtbuffer is interrupted, then restart it. --- confluent_server/confluent/consoleserver.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/consoleserver.py b/confluent_server/confluent/consoleserver.py index 6b8a0e2f..d9707a36 100644 --- a/confluent_server/confluent/consoleserver.py +++ b/confluent_server/confluent/consoleserver.py @@ -603,13 +603,23 @@ async def _start_tenant_sessions(cfm): event=log.Events.stacktrace) cfm.watch_nodecollection(_nodechange) +running = True +async def run_buffer_daemon(): + global _bufferdaemon + while running: + _bufferdaemon = await asyncio.subprocess.create_subprocess_exec( + '/opt/confluent/bin/vtbufferd', 'confluent-vtbuffer') + await _bufferdaemon.wait() + + async def initialize(): global _tracelog global _bufferdaemon _tracelog = log.Logger('trace') - _bufferdaemon = await asyncio.subprocess.create_subprocess_exec( - '/opt/confluent/bin/vtbufferd', 'confluent-vtbuffer') + tasks.spawn(run_buffer_daemon()) + #_bufferdaemon = await asyncio.subprocess.create_subprocess_exec( + # '/opt/confluent/bin/vtbufferd', 'confluent-vtbuffer') #_bufferdaemon = subprocess.Popen( # ['/opt/confluent/bin/vtbufferd', 'confluent-vtbuffer'], bufsize=0, stdin=subprocess.DEVNULL, # stdout=subprocess.DEVNULL)