aleph-im / aleph-vm

Aleph.im VM execution engine
MIT License
43 stars 18 forks source link

Fix: dictionary changed size during iteration #699

Closed hoh closed 2 months ago

hoh commented 2 months ago

Iterating over the keys of a dictionary is a lazy operation that uses a generator under the hood.

An error was reported on Sentry due to "RuntimeError: dictionary changed size during iteration". Error on Sentry

This error was introduced by @nesitor on PR https://github.com/aleph-im/aleph-vm/pull/679

Self proofreading checklist

Changes

This fixes the issue by transforming the generator into a list, which is the standard way to approach this issue in Python.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.20%. Comparing base (7ee7d04) to head (52f5767). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/aleph/vm/orchestrator/tasks.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #699 +/- ## ======================================= Coverage 62.20% 62.20% ======================================= Files 69 69 Lines 6073 6073 Branches 641 641 ======================================= Hits 3778 3778 Misses 2143 2143 Partials 152 152 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.