Skip to content

Commit

Permalink
Fix parallel node pool creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Obliviour committed Nov 21, 2023
1 parent 00ac14d commit aebe6ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xpk.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,12 @@ def run_command_batch(commands, jobname, per_command_name, output_logs):
children = []
start_time = datetime.datetime.now()
for i, command in enumerate(commands):
with subprocess.Popen(
command, stdout=output_logs[i], stderr=output_logs[i], shell=True
) as task:
children.append(task)
children.append(
# subprocess managed by list pylint: disable=consider-using-with
subprocess.Popen(
command, stdout=output_logs[i], stderr=output_logs[i], shell=True
)
)

while True:
returncodes = [child.poll() for child in children]
Expand Down

0 comments on commit aebe6ba

Please sign in to comment.