https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44023
--- Comment #1 from Johan Larsson <[email protected]> --- Created attachment 210827 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210827&action=edit Bug 44023: es_indexer_daemon.pl never recognises NoNodes The QA follow-up for bug 42669 detects NoNodes with ref($_) eq 'Search::Elasticsearch::Error::NoNodes'. But update_index() catches every Search::Elasticsearch error and rethrows it as Koha::Exceptions::Elasticsearch::BadResponse, with the original error class in ->type. The caught exception is therefore never a NoNodes object, the check never matches, and an unreachable Elasticsearch still ends with the jobs marked 'failed'. Check the type of the BadResponse as well (the plain class check is kept for any code path that lets the raw error through). The retry only helps with JobsNotificationMethod = polling. With STOMP the message is acknowledged before commit() and the daemon only reads the background_jobs table in polling mode, so a job reset to 'new' is not picked up again. That needs a separate change. Test plan: 1. Run misc/workers/es_indexer_daemon.pl with polling (JobsNotificationMethod = polling). 2. Block access to Elasticsearch (stop it, or firewall the port). 3. Modify a record so an indexing job is enqueued. => Without the patch the job ends 'failed'; the log shows 'Update of elastic index failed with: ... type => NoNodes'. => With the patch the log shows 'Elasticsearch unavailable (NoNodes), resetting jobs for retry' and the job goes back to 'new'. 4. Restore Elasticsearch. => The job is picked up again and finishes; the record is searchable. (With STOMP the job stays 'new', see above.) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
