diff --git a/CHANGELOG.md b/CHANGELOG.md index e50c9c7..910719f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.3.1] - 2025-09-11 + +### Fixed + +- Fix EOF bug in interfaceAdm() + ## [8.3.0] - 2025-08-29 ### Changed diff --git a/src/VERSION b/src/VERSION index ae9a76b..56b6be4 100644 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -8.0.0 +8.3.1 diff --git a/src/opengnsys/workers/oglive_worker.py b/src/opengnsys/workers/oglive_worker.py index 537d3f5..7c1ec5e 100644 --- a/src/opengnsys/workers/oglive_worker.py +++ b/src/opengnsys/workers/oglive_worker.py @@ -266,12 +266,9 @@ class ogLiveWorker(ServerWorker): def interfaceAdmin (self, method, parametros=[]): if method not in ['ConsolaRemota', 'procesaCache']: - ## python - logger.debug (f'({method}) is a python method') exe = '{}/{}'.format (self.pathinterface, method) proc = [exe]+parametros else: - ## bash logger.debug (f'({method}) is a bash method') exe = '{}/{}'.format (self.pathinterface, method) @@ -297,31 +294,38 @@ class ogLiveWorker(ServerWorker): #logger.debug ('no queue--not writing any PID to it') pass - sout = serr = '' - finished = False - out_finished = False err_finished = False + finished = False buf_size = 4096 stdout_buf = bytes() stderr_buf = bytes() while True: - ready_to_read, _, exceptions = select.select ([p.stdout, p.stderr], [], [p.stdout, p.stderr], 0.2) + check_read = [] + check_exceptions = [] + if not out_finished: + check_read.append (p.stdout) + check_exceptions.append (p.stdout) + if not err_finished: + check_read.append (p.stderr) + check_exceptions.append (p.stderr) + + ready_to_read, _, exceptions = select.select (check_read, [], check_exceptions, 0.2) if p.stdout in ready_to_read: data = p.stdout.read(buf_size) stdout_buf = stdout_buf + data - if len(data) < buf_size: + if 0 == len(data): out_finished = True if p.stderr in ready_to_read: - data = p.stdout.read(buf_size) + data = p.stderr.read(buf_size) stderr_buf = stderr_buf + data - if len(data) < buf_size: + if 0 == len(data): err_finished = True if p.stdout in exceptions or p.stderr in exceptions: @@ -335,12 +339,13 @@ class ogLiveWorker(ServerWorker): sout = stdout_buf.decode('utf-8', 'ignore').strip() - serr = stdout_buf.decode('utf-8', 'ignore').strip() + serr = stderr_buf.decode('utf-8', 'ignore').strip() try: p.wait (0.1) finished = True except subprocess.TimeoutExpired: + ## BUG: dejamos un zombie colgando pass