Message292346
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 |
|
Date |
User |
Action |
Args |
2017-04-26 13:52:50 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka, davin |
2017-04-26 13:52:50 | vstinner | set | messageid: <1493214770.49.0.943228970697.issue30171@psf.upfronthosting.co.za> |
2017-04-26 13:52:50 | vstinner | link | issue30171 messages |
2017-04-26 13:52:50 | vstinner | create | |
|