music960633 / DSnP_grading

4 stars 0 forks source link

KeyError in TaskRunner #2

Open music960633 opened 6 years ago

music960633 commented 6 years ago

Sometimes waitpid() will get a return value that is not a pid of a running task, causing KeyError.

Traceback (most recent call last):
  File "./parallel_test.py", line 52, in <module>
    main()
  File "./parallel_test.py", line 42, in main
    runtime = runParallel(i)
  File "./parallel_test.py", line 25, in runParallel
    runner.run()
  File "/localHDD/music960633/DSnP/DSnP_grading/py/utils/task_runner.py", line 70, in run
    self.waitUntilLessThan(self.parallel_num)
  File "/localHDD/music960633/DSnP/DSnP_grading/py/utils/task_runner.py", line 80, in waitUntilLessThan
    name, task = self.running_task.pop(pid)
KeyError: 12956
music960633 commented 6 years ago

Looking into root cause, this commit temporarily fix it.