Currently, we try/catch our batched ES updates and mark all the jobs we batched as finished no matter the outcome: es_indexer_daemon.pl: try { $biblio_indexer->update_index( \@bib_chunk ); } catch { $logger->warn( sprintf "Update of elastic index failed with: %s", $_ ); }; . . . # Finish $jobs->update({ progress => 1, status => 'finished', ended_on => \'NOW()', }); In the catch we should create a new background job to resubmit the failed jobs
Created attachment 180800 [details] [review] Bug 39605: Resubmit failed ES background jobs This patch adds a resubmission of an indexing chunk that fails as a new background job To test: 0 - Have KTD using ES 1 - Apply patch, restart all 2 - Update a record 3 - Check background jobs and confirm it worked 4 - Edit koha-conf and set ES port to 9201, restart_all 5 - Update a record 6 - Check background jobs 7 - The job should be failing and creating new jobs 8 - Edit koha-conf and fix the port, restart_all 9 - Confirm the newest job now succeeds
If there's a problem with the record, couldn't this lead to an infinite loop?
(In reply to David Cook from comment #2) > If there's a problem with the record, couldn't this lead to an infinite loop? I thought the same thing. I think this needs an answer before we can consider signing off.