1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-13 16:01:32 +03:00

Fixed stdout and stderr forking porcs handling

This commit is contained in:
Leonid Fedorov
2023-06-14 14:24:13 +00:00
committed by Alan Mologorsky
parent 780232b29f
commit d2d0e08690

View File

@ -58,7 +58,7 @@ class S3DataLoadController:
for dangerous symbols so just raise error for injection dangerous
symbols in params.
"""
dangerous_symbols = ' &|;\n\r`$'
dangerous_symbols = ' #&|;\n\r`$'
for symbol in dangerous_symbols:
if symbol in param:
response_error(
@ -288,24 +288,32 @@ class S3DataLoadController:
cpimport_error = ''
cpimport_output = ''
alive = 3
while alive > 0:
while True:
events = selector.select()
for key, mask in events:
name = key.data
line = key.fileobj.readline().rstrip()
if not line:
# EOF
alive -= 1
selector.unregister(key.fileobj)
continue
if name == 'downloader_error':
if name == 'downloader_error' and line:
downloader_error += line + '\n'
if name == 'cpimport_error':
if name == 'cpimport_error' and line:
cpimport_error += line + '\n'
if name == 'cpimport_output':
if name == 'cpimport_output' and line:
cpimport_output += line + '\n'
if downloader_error:
response_error(downloader_error)
if cpimport_error:
response_error(cpimport_error)
cpimport_status = cpimport_proc.poll()
download_status = download_proc.poll()
if cpimport_status is not None \
and download_status is not None:
break
# clean after Prepare Google
if storage == 'gs' and os.path.exists(temporary_config):
os.remove(temporary_config)