[issue46954] Awaiting multiple times on same task increases memory usage unboundedly

2022-03-09 Thread Irit Katriel


Irit Katriel  added the comment:

This is a duplicate of bpo-45924.  The traceback accumulates another frame 
every time the exception is raised. To see that, change main in your script to 

async def main():
task = asyncio.create_task(task_that_raise())
while True:
try:
await task
except Exception as e:
print("<<<")
traceback.print_exception(e)
print(">>>")



and notice that in the output, X grows every time in the line like

[Previous line repeated X more times]

--
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Incorrect traceback when future's exception is raised multiple 
times
versions:  -Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46954] Awaiting multiple times on same task increases memory usage unboundedly

2022-03-08 Thread David M.


New submission from David M. :

Awaiting multiple times on a single task that failed with an exception results 
in an unbounded increase in memory usage. Enough repeated "await"s of the task 
can result in an OOM.

The same pattern on a task that didn't raise an exception behaves as expected.

The attached short script ends up using more than 1GB of memory in less than a 
minute.

--
components: asyncio
files: multi_await_exception.py
messages: 414739
nosy: asvetlov, davidmanzanares, yselivanov
priority: normal
severity: normal
status: open
title: Awaiting multiple times on same task increases memory usage unboundedly
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50664/multi_await_exception.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com