node-gallery
node-gallery copied to clipboard
File descriptor leaks lead to dysfunctional app
Reproduce:
Run nodejs app.js
and watch lsof -p <PID of app.js> | wc -l
increase with every gallery refresh. When the number of open file descriptors exceeds ulimit -n
, app.js will stop working with, e.g.
{"message":"File not found","error":null}
{"message":"File not found","error":{"errno":20,"code":"EMFILE","path":"resources/photos/studio-2015/IMG_7795.JPG"}}
{"message":"No album found","error":{"errno":20,"code":"EMFILE","path":"./resources/photos/studio-2015"}}