Merge pull request 'refs #2776 Fix EOF bug in interfaceAdm()' (#62) from interfaceadm into main
ogagent/pipeline/tag There was a failure building this commit
Details
ogagent/pipeline/tag There was a failure building this commit
Details
Reviewed-on: #62pull/63/head 8.3.1
commit
d945d8566e
|
|
@ -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/),
|
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).
|
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
|
## [8.3.0] - 2025-08-29
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
8.0.0
|
8.3.1
|
||||||
|
|
|
||||||
|
|
@ -266,12 +266,9 @@ class ogLiveWorker(ServerWorker):
|
||||||
|
|
||||||
def interfaceAdmin (self, method, parametros=[]):
|
def interfaceAdmin (self, method, parametros=[]):
|
||||||
if method not in ['ConsolaRemota', 'procesaCache']:
|
if method not in ['ConsolaRemota', 'procesaCache']:
|
||||||
## python
|
|
||||||
logger.debug (f'({method}) is a python method')
|
|
||||||
exe = '{}/{}'.format (self.pathinterface, method)
|
exe = '{}/{}'.format (self.pathinterface, method)
|
||||||
proc = [exe]+parametros
|
proc = [exe]+parametros
|
||||||
else:
|
else:
|
||||||
## bash
|
|
||||||
logger.debug (f'({method}) is a bash method')
|
logger.debug (f'({method}) is a bash method')
|
||||||
exe = '{}/{}'.format (self.pathinterface, method)
|
exe = '{}/{}'.format (self.pathinterface, method)
|
||||||
|
|
||||||
|
|
@ -297,31 +294,38 @@ class ogLiveWorker(ServerWorker):
|
||||||
#logger.debug ('no queue--not writing any PID to it')
|
#logger.debug ('no queue--not writing any PID to it')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
sout = serr = ''
|
|
||||||
finished = False
|
|
||||||
|
|
||||||
out_finished = False
|
out_finished = False
|
||||||
err_finished = False
|
err_finished = False
|
||||||
|
finished = False
|
||||||
|
|
||||||
buf_size = 4096
|
buf_size = 4096
|
||||||
stdout_buf = bytes()
|
stdout_buf = bytes()
|
||||||
stderr_buf = bytes()
|
stderr_buf = bytes()
|
||||||
|
|
||||||
while True:
|
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:
|
if p.stdout in ready_to_read:
|
||||||
data = p.stdout.read(buf_size)
|
data = p.stdout.read(buf_size)
|
||||||
stdout_buf = stdout_buf + data
|
stdout_buf = stdout_buf + data
|
||||||
|
|
||||||
if len(data) < buf_size:
|
if 0 == len(data):
|
||||||
out_finished = True
|
out_finished = True
|
||||||
|
|
||||||
if p.stderr in ready_to_read:
|
if p.stderr in ready_to_read:
|
||||||
data = p.stdout.read(buf_size)
|
data = p.stderr.read(buf_size)
|
||||||
stderr_buf = stderr_buf + data
|
stderr_buf = stderr_buf + data
|
||||||
|
|
||||||
if len(data) < buf_size:
|
if 0 == len(data):
|
||||||
err_finished = True
|
err_finished = True
|
||||||
|
|
||||||
if p.stdout in exceptions or p.stderr in exceptions:
|
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()
|
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:
|
try:
|
||||||
p.wait (0.1)
|
p.wait (0.1)
|
||||||
finished = True
|
finished = True
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
|
## BUG: dejamos un zombie colgando
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue