I've had a library accidentally try to import a record with bad data, and the MARC import is silently stopping. The background job stays stuck as "Started" and the batch stays stuck as "Staged". Glancing at the code... it looks like it should work. Going to spend a couple minutes trying to figure this one out...
This is so bizarre... I've added all this debugging code, and according to the code it is updating... but it's not actually updating the database. It looks a lot like a transaction related issue... but DBIx::Class's transaction handling leaves a lot to be desired...
Tricky trying to reproduce the scenario. Haven't yet received the real MARC file with the problem, and my attempts to re-create one yield either a MARC file that succeeds or fails to stage...
Interestingly it seems easier to sneak bad bytes into Koha through MARC records rather than MARCXML records... especially when you provide multiple records with some of the records being 100% OK.
I've got the file, and tried it again in my dev environment, which should be pretty much the same as the backup system it's not working on... but in local dev the background job is correctly marked as "Failed", although the batch is still marked as "Staged" instead of failed...
I can't reproduce this now so going to close it for now...