Closed aaknitt closed 3 years ago
This might be a problem with gevent. I will look into this
For what it's worth, I updated gevent on my Pi from 1.4.0 to 21.8.0 and it's still having the same issue.
Any suggestions for workarounds to get time.sleep() type functionality within a thread?
I also confirmed that this is likely an issue in gevent and opened an issue there: https://github.com/gevent/gevent/issues/1816
Closing based on this: https://github.com/gevent/gevent/issues/1816
Eel version 0.11.1
Describe the bug When eel.sleep() is called from another thread, an anon_inode is created. If this happens enough, a "too many files open" error from the OS can be produced. For example, on a Raspberry Pi the default maximum number of file descriptors that a single process can have open is 1024. So if eel.sleep() is called 1024 times from a thread, this error will occur.
To Reproduce Minimal script to produce issue (reproducible on a Raspberry Pi running standard OS):
After this script is started, check the number of file descriptors that it has open by running (it will increase quickly):
lsof -p [PID of script] | wc -l
After about 11 seconds the "too many files open" error will occur.
Additional context Based on this, it seems that this could potentially be an underlying issue with gevent: https://stackoverflow.com/questions/50300407/python-ubuntu-too-many-open-files-eventpoll
Also see here: https://github.com/eventlet/eventlet/issues/197