We just got some of our devices that throw “too many open files” errors.
When we display which process consumes open files, mender and mender connect use a lot
We are on raspbian an ulimit (soft limit) is set to 1024.
Is there something wrong with our installation or mender do use a lot of open files.
Thanks for your help
I took a look at this and immediately noticed one file descriptor which is not closed, which I’ve fixed here. Perhaps you could give this a try?
It doesn’t necessarily fix your problem though, since the garbage collector should have cleaned this up eventually anyway. So there may be a deeper problem. If you’re still seeing the problem after attempting that patch (or if applying it is tricky), could you run this command on the device after some file descriptors have accumulated, and post the result?
Hmm, I would have expected a far greater number of entries. In your first post, mender had more than 700 open file descriptors. Why does it have so few in the next post? Can you try to match the two?
Looks like lsof lists a lot of extra things as well, such as memory mappings. It also relists everything for every thread which exists in the process, even though they share the open file descriptors, which artificially increases the number a lot. So I would trust the data from /proc more.
However, I could confirm that quite a few descriptors were being held open by the /etc/mender/scripts/version file, which I fixed in the pull request mentioned in my first reply. I would retry with this patch.
But you could also just wait. We are working on making new releases as we speak, so it won’t be too long before they are out and available as binary packages.