Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused key in iteration of task dictionary #2863

Merged
merged 1 commit into from
Aug 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,8 +1146,11 @@ def wait_for_current_tasks(self) -> None:

logger.info("Waiting for all remaining tasks to complete")

items = list(self.tasks.items())
for task_id, task_record in items:
# .values is made into a list immediately to reduce (although not
# eliminate) a race condition where self.tasks can be modified
# elsewhere by a completing task being removed from the dictionary.
task_records = list(self.tasks.values())
for task_record in task_records:
# .exception() is a less exception throwing way of
# waiting for completion than .result()
fut = task_record['app_fu']
Expand Down
Loading