This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Protocol dealloc not called if Server is closed
Type: resource usage Stage: resolved
Components: asyncio Versions: Python 3.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: MarkReedZ, asvetlov, yselivanov
Priority: normal Keywords:

Created on 2021-09-07 23:52 by MarkReedZ, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (1)
msg401349 - (view) Author: Mark (MarkReedZ) Date: 2021-09-07 23:52
If I create_server

    server_coro = loop.create_server( lambda: self._protocol_factory(self), sock=sock, ssl=ssl)
    server = loop.run_until_complete(server_coro)

Then connect and disconnect a client the protocol connection lost and dealloc are called.

If however I close the server with existing connections then protocol dealloc is never called and I leak memory due to a malloc in my protocol.c init.

      server.close()
      loop.run_until_complete(server.wait_closed())
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89297
2021-09-18 15:09:17MarkReedZsetstatus: open -> closed
stage: resolved
2021-09-07 23:52:45MarkReedZcreate