Author EmperorBale
Recipients EmperorBale, asvetlov, valid22, yselivanov
Date 2020-09-16.05:41:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600234888.13.0.392251732884.issue41794@roundup.psfhosted.org>
In-reply-to
Content
In the file I attached below is a pretty simple asyncio server, it is identical to the echo server on the documentation except it does not disconnect after echoing. 

When a connection is received, it creates an object called "test object" and the only reference to that object is on the local scope. If all is working properly, when the handler function returns the test object should also be deleted, but I noticed the __del__ method is not being called, indicating python is not deleting it. It seems like a reference to the frame of the handler is being kept in a list (not sure where) and it is not being removed from it.

Here is example code of how to trigger the bug:
s = socket.socket();s.connect(("127.0.0.1", 8888));s.send(b"test\0")
s.close()

By sending data and closing afterwards WITHOUT using s.recv() causes the issue, what's interesting is that if we call s.close() immediately after sending, the object is deleted by the server and everything works as intended. Calling s.close() a few seconds after, causes the bug to happen. It should also be noted that if I call s.recv() before s.close(), the bug does not happen.

What's more interesting is that when I run the above code in my python3.5 interpreter the bug does not get triggered, no matter what I do. The bug does also not happen when I run it in a python3.8 interpreter on my windows computer. When I run on the code on ubuntu on a python3.8 interpreter, the bug is triggered.
History
Date User Action Args
2020-09-16 05:41:28EmperorBalesetrecipients: + EmperorBale, asvetlov, yselivanov, valid22
2020-09-16 05:41:28EmperorBalesetmessageid: <1600234888.13.0.392251732884.issue41794@roundup.psfhosted.org>
2020-09-16 05:41:28EmperorBalelinkissue41794 messages
2020-09-16 05:41:27EmperorBalecreate