New submission from STINNER Victor: A multiprocessing Queue object managers multiple resources:
* a multiprocessing Pipe * a thread * (a lock and a semaphore) If a Queue is not cleaned up properly, your application may leak many resources. Try attached queue_leak.py to see an example "leaking a thread". I suggest to emit a ResourceWarning warning in Queue destrutor. I don't know what should be the test to decide if a warning must be emitted? * if the queue wasn't closed yet? * if the thread is alive? * if the queue wasn't closed yet and/or the thread is alive? (my favorite choice) Other examples of objects emitting ResourceWarning: * io files: io.FileIO, io.TextIOWrapper, etc. * socket.socket * subprocess.Popen: I recently added a ResourceWarning on that one * asyncio transports and event loops ---------- components: Library (Lib) files: queue_leak.py messages: 292346 nosy: davin, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Emit ResourceWarning in multiprocessing Queue destructor type: resource usage versions: Python 3.7 Added file: http://bugs.python.org/file46830/queue_leak.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30171> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com