So, the problem is, when tapdisk wants to close AND remove a file it needs to go through all the possible rotated files. Because my belief is, each process should mind his own business, rotated files are logrotate business.

My suggested approach here is, because there could be a lot of files not worth being rotated, let's change the rotation rules.

If you set the rotation basis to "weekly", keeping "size" at a reasonable value, we avoid rotated files unless worth doing. So, in normal circumstances, every tapdisk process has to clean only the current open file, if needed). If a rotation happened, it just means something potentially serious has happened or that the file has been open for a long time (so the process lasted for long enough to be worth wasting space to keep its logs).
"count" can be set to a lower value, too.


So, the final point is, tapdisk should not know anything about rotate files. If there are rotated files, the problem must be addressed in logrotate domain.