Fix file descriptor leak in LogBuffer when closing runtime

This commit is contained in:
openhands
2024-11-14 14:40:47 +00:00
parent 06b0dd387a
commit 984b46098b

View File

@@ -111,6 +111,9 @@ class LogBuffer:
def close(self, timeout: float = 5.0):
self._stop_event.set()
self.log_stream_thread.join(timeout)
# Close the log generator to release the file descriptor
if hasattr(self.log_generator, 'close'):
self.log_generator.close()
class EventStreamRuntime(Runtime):