Skip to content

Commit

Permalink
HOTFIX: Fixed a bug in submitting nodes to the ThreadPool, where the …
Browse files Browse the repository at this point in the history
…second node would never be submitted, but still removed from the list (#124)
  • Loading branch information
neuneck authored Jan 27, 2020
1 parent af5db92 commit 427d3f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flowpipe/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,14 @@ def node_runner(node):
with futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
while nodes_to_evaluate or running_futures:
# Submit new nodes that are ready to be evaluated
not_submitted = []
for node in nodes_to_evaluate:
if not any(n.is_dirty for n in node.upstream_nodes):
fut = executor.submit(node_runner, node)
running_futures.append(fut)
nodes_to_evaluate.remove(node)
else:
not_submitted.append(node)
nodes_to_evaluate = not_submitted

# Wait until a future finishes, then remove all finished nodes
# from the relevant lists
Expand Down

0 comments on commit 427d3f4

Please sign in to comment.