You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you accidentally cause a StopIteration exception to be thrown inside a transaction (txn stuff), nothing will appear in the logs even though everything blew up. It never reaches our try/except block that normally handles logging the exceptions.
You can run easily run into this by using something like next(iter(my_map.keys())) (to grab the first key in the iterable) where my_map is just an empty dictionary. But this problem is easily reproduced by just doing raise StopIteration directly.
Spawning from #17512 (comment),
If you accidentally cause a
StopIteration
exception to be thrown inside a transaction (txn
stuff), nothing will appear in the logs even though everything blew up. It never reaches ourtry
/except
block that normally handles logging the exceptions.You can run easily run into this by using something like
next(iter(my_map.keys()))
(to grab the first key in the iterable) wheremy_map
is just an empty dictionary. But this problem is easily reproduced by just doingraise StopIteration
directly.Dev notes
Seems related to https://peps.python.org/pep-0479/ but that makes it seem like with that change (since Python 3.7),
StopIteration
shouldn't be silently ignored like it is now.I'm guessing this is a bad interaction between the
with
context managers at various points andmake_deferred_yieldable(...)
swallowing it.There have been more recent related issues around this like python/cpython#112182
The text was updated successfully, but these errors were encountered: