Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kepub: Fixed FD leak in content transformation
The FDs didn't get closed until after all content files were processed due to the deferred close being in a for loop. This wasn't noticed due to it not being an issue until the concurrency in cbb9af0 causing it to exceed the default FD limit on macOS for a large (500+ content file) book. I've ensured there weren't any other leaks left behind by testing this with a batch conversion of large books and a ulimit of the theoretical maximum amount kepubify should have: 5 + max(1, max(cpu_cores, cpu_cores*max(3, cpu_cores + 1)) | | | | | ^ kepub (transformAllContentParallel): parallel content file transformation (+1 for scanning) | | | | ^ kepub (ConvertEPUB): packing/unpacking (zip+input_output+temp) | | | ^ cmd/kepubify (convert): concurrent conversion | | ^ cmd/kepubify (convert): concurrent scanning/copying | ^ cmd/kepubify (transform): path transformation ^ cmd/kepubify: kepubify itself (binary/stdout/stderr/etc...) This issue was reported by email on 2020-01-01.
- Loading branch information