niklasb / webkit-server

[not actively maintained] The C++ webkit-server from capybara-webkit with useful extensions and Python bindings
MIT License
48 stars 38 forks source link

Use communicate() to ensure standard file descriptors are closed #32

Closed ralish closed 7 years ago

ralish commented 7 years ago

This internally calls wait() but also ensures that any file descriptors for stdin, stdout, and stderr are closed. If we don't do this we'll leak file descriptors. For long running processes that start & stop a WebKit server many times this can result in an eventual crash due to hitting the max open files limit on the underlying system.

niklasb commented 7 years ago

Please revert commit 251b828 since it is unrelated to the provided bugfix. Then I can merge your branch.

niklasb commented 7 years ago

Thanks!

ralish commented 7 years ago

Apologies! Meant to commit that to a different branch (which I've now done) to ease installing the fix in our internal projects via pip requirements files.