Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
container exec leaks file handles #209
Comments
maikeueule
commented
Jan 20, 2017
|
Hi, I noticed that it does not only leaks file handles, but also Threads, which might lead your program to reach the maximum number of allows threads, eg if using container.execute() a lot. A fix seems to do as indicated in the ws4py doc, after the while loop:
|
rockstar
closed this
Jan 26, 2017
CuriousBadger277
commented
Jan 26, 2017
|
Link to the matching pull request for reference #211 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CuriousBadger277 commentedDec 9, 2016
Hi,
First of all, thanks for the great library implementation!
I'm having issues with container exec. I want to use this to manage a moderately large fleet of containers and found that after running exec enough times you run out of FDs.
I'm using the following versions (via pip) which I believe to be up to date:
To reproduce run this script in terminal 1 (may need minor fixups):
If you leave this long enough you'll hit the process limit on file descriptors, alternatively you can open a second terminal and watch the fd list grow from proc:
I've tracked this down to what I believe are the websockets in the execute function:
At this point I gave up due to time constraints but my best guess is it's because the manager runs its own thread and so needs to be released manually using manager.close() ([http://ws4py.readthedocs.io/en/latest/sources/ws4py/#ws4py.manager.WebSocketManager]).