consider adding repo cleanup for failed files
there is a known issue that if a file somehow fails in the middle of processing (e.g. due to an I/O error within the input file), borg will have written some of the content chunks to the repo, but then will abort processing that single file without adding a file item to the archive that references these chunks. borg will process all other remaining files and then commit.
this is how orphaned chunks can get created. borg check will then report an issue and will clean up these orphaned chunks.
in item.chunks we have the list of chunkids we'ld need to remove again within the exception handler or a finally:.
Low severity bug. The biggest issue is that users are getting irritated about where the orphans come from.
The final fix was in there: https://github.com/borgbackup/borg/pull/7349