Closed bbpennel closed 2 weeks ago
I've opened a PR which seems to fix the issue on our local servers. I've done several hundred purge requests without any new file handles being added.
Fixed via https://github.com/cantaloupe-project/cantaloupe/commit/0dccf299b9310f2293e6cb467799a5345fd58e39 Thanks for your contribution @bbpennel!
We have an automated workflow that makes requests to the "PurgeItemFromCache" API endpoint in cantaloupe 5.0.5 after a jp2 gets replaced in our system, so that all of its derivatives in cantaloupe's cache will get regenerated. But we've had cantaloupe run out of file handles repeatedly while regenerating a set of 5700 jp2s.
I'm able to replicate the issue pretty easily in our system by making concurrent calls to "PurgeItemFromCache" with a populated cache. If I monitor the file handles held by the process, I can watch them quickly pile up and never be released. They are basically all references to empty directories, like:
I don't know if the same issue occurs with a request to purge the whole cache, or when the background cache clearing processes run. This is occurring in a RHEL7 server. I don't see any similar behaviors come from read requests to cantaloupe, like requesting tiles or thumbnails.