You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Fixed stdout and stderr forking porcs handling
This commit is contained in:
committed by
Alan Mologorsky
parent
780232b29f
commit
d2d0e08690
@ -58,7 +58,7 @@ class S3DataLoadController:
|
|||||||
for dangerous symbols so just raise error for injection dangerous
|
for dangerous symbols so just raise error for injection dangerous
|
||||||
symbols in params.
|
symbols in params.
|
||||||
"""
|
"""
|
||||||
dangerous_symbols = ' &|;\n\r`$'
|
dangerous_symbols = ' #&|;\n\r`$'
|
||||||
for symbol in dangerous_symbols:
|
for symbol in dangerous_symbols:
|
||||||
if symbol in param:
|
if symbol in param:
|
||||||
response_error(
|
response_error(
|
||||||
@ -288,24 +288,32 @@ class S3DataLoadController:
|
|||||||
cpimport_error = ''
|
cpimport_error = ''
|
||||||
cpimport_output = ''
|
cpimport_output = ''
|
||||||
|
|
||||||
alive = 3
|
while True:
|
||||||
while alive > 0:
|
|
||||||
events = selector.select()
|
events = selector.select()
|
||||||
for key, mask in events:
|
for key, mask in events:
|
||||||
name = key.data
|
name = key.data
|
||||||
line = key.fileobj.readline().rstrip()
|
line = key.fileobj.readline().rstrip()
|
||||||
if not line:
|
if name == 'downloader_error' and line:
|
||||||
# EOF
|
|
||||||
alive -= 1
|
|
||||||
selector.unregister(key.fileobj)
|
|
||||||
continue
|
|
||||||
if name == 'downloader_error':
|
|
||||||
downloader_error += line + '\n'
|
downloader_error += line + '\n'
|
||||||
if name == 'cpimport_error':
|
if name == 'cpimport_error' and line:
|
||||||
cpimport_error += line + '\n'
|
cpimport_error += line + '\n'
|
||||||
if name == 'cpimport_output':
|
if name == 'cpimport_output' and line:
|
||||||
cpimport_output += line + '\n'
|
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
|
# clean after Prepare Google
|
||||||
if storage == 'gs' and os.path.exists(temporary_config):
|
if storage == 'gs' and os.path.exists(temporary_config):
|
||||||
os.remove(temporary_config)
|
os.remove(temporary_config)
|
||||||
|
Reference in New Issue
Block a user