You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from IPython.kernel import KernelManager
for i in range(1000):
km = KernelManager()
km.start_kernel(extra_arguments=['--pylab=inline'])
kc = km.client()
kc.start_channels()
kc.stop_channels()
km.shutdown_kernel(now=True)
causes the following exception after ~27 iterations:
Traceback (most recent call last):
File "test_ipython.py", line 6, in <module>
File "/Users/tom/Library/Python/2.7/lib/python/site-packages/IPython/kernel/manager.py", line 202, in start_kernel
File "/Users/tom/Library/Python/2.7/lib/python/site-packages/IPython/kernel/connect.py", line 481, in write_connection_file
File "/Users/tom/Library/Python/2.7/lib/python/site-packages/IPython/kernel/connect.py", line 110, in write_connection_file
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 187, in __init__
socket.error: [Errno 24] Too many open files
It looks like some file handles are not getting closed? I had a look and didn't see anything obvious. This is relevant for e.g. runipy because it starts and stops the kernel each time a different notebook is run.
(also, the error occurs even if I set now=False).
The text was updated successfully, but these errors were encountered:
I should also note that OS X has an unusually low FD limit (256 by default, while most other systems use 1024). You can easily push this limit up with ulimit -n 1024.
The following code:
causes the following exception after ~27 iterations:
It looks like some file handles are not getting closed? I had a look and didn't see anything obvious. This is relevant for e.g. runipy because it starts and stops the kernel each time a different notebook is run.
(also, the error occurs even if I set
now=False
).The text was updated successfully, but these errors were encountered: