Bugzilla – Attachment 119615 Details for
Bug 26312
Add some error handling during Elasticsearch indexing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26312: (follow-up) Fix passing of exception messages
Bug-26312-follow-up-Fix-passing-of-exception-messa.patch (text/plain), 3.10 KB, created by
Joonas Kylmälä
on 2021-04-15 11:30:44 UTC
(
hide
)
Description:
Bug 26312: (follow-up) Fix passing of exception messages
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2021-04-15 11:30:44 UTC
Size:
3.10 KB
patch
obsolete
>From a3145609b67b1b7acd52053ac70507d76c2eee44 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 1 Apr 2021 13:49:19 +0000 >Subject: [PATCH] Bug 26312: (follow-up) Fix passing of exception messages >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >'error' has special meaning in exceptions so naming the fields: >type, details > >Rather than only dealing with a single exception type, we generically >get the ES exception info and pass it up. > >I could not recreate timeout still, however, I simply restarted the >ES docker during commit stage to cause NoNodes exceptions > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > Koha/Exceptions/Elasticsearch.pm | 2 +- > Koha/SearchEngine/Elasticsearch/Indexer.pm | 6 ++---- > misc/search_tools/rebuild_elasticsearch.pl | 6 ++---- > 3 files changed, 5 insertions(+), 9 deletions(-) > >diff --git a/Koha/Exceptions/Elasticsearch.pm b/Koha/Exceptions/Elasticsearch.pm >index 7ad8538069..2068db9fda 100644 >--- a/Koha/Exceptions/Elasticsearch.pm >+++ b/Koha/Exceptions/Elasticsearch.pm >@@ -25,7 +25,7 @@ use Exception::Class ( > 'Koha::Exceptions::Elasticsearch::BadResponse' => { > isa => 'Koha::Exceptions::Elasticsearch', > description => 'Bad response received when submitting request to Elasticsearch', >- fields => [ 'error', 'details' ] >+ fields => [ 'type', 'details' ] > }, > 'Koha::Exceptions::Elasticsearch::MARCFieldExprParseError' => { > isa => 'Koha::Exceptions::Elasticsearch', >diff --git a/Koha/SearchEngine/Elasticsearch/Indexer.pm b/Koha/SearchEngine/Elasticsearch/Indexer.pm >index 43c2c8d193..0c9b3ff380 100644 >--- a/Koha/SearchEngine/Elasticsearch/Indexer.pm >+++ b/Koha/SearchEngine/Elasticsearch/Indexer.pm >@@ -125,12 +125,10 @@ sub update_index { > carp "One or more ElasticSearch errors occurred when indexing documents"; > } > } catch { >- if( ref $_ eq 'Search::Elasticsearch::Error::Timeout' ){ > Koha::Exceptions::Elasticsearch::BadResponse->throw( >- error => "Record commit failed.", >- details => "Timeout", >+ type => $_->{type}, >+ details => $_->{text}, > ); >- } > }; > } > return $response; >diff --git a/misc/search_tools/rebuild_elasticsearch.pl b/misc/search_tools/rebuild_elasticsearch.pl >index 19839ff6da..3b25709a76 100755 >--- a/misc/search_tools/rebuild_elasticsearch.pl >+++ b/misc/search_tools/rebuild_elasticsearch.pl >@@ -309,10 +309,8 @@ sub _do_reindex { > _handle_response($response); > _log( 1, "Commit complete\n" ); > } catch { >- if( ref $_ eq 'Koha::Exceptions::Elasticsearch::BadResponse'){ >- _log(1,$_->{error}); >- _log(2,$_->{details}); >- } >+ _log(1,"Elasticsearch exception thrown: ".$_->type."\n"); >+ _log(2,"Details: ".$_->details."\n"); > }; > $commit_count = $commit; > @id_buffer = (); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26312
:
109241
|
109626
|
113501
|
114229
|
117618
|
117619
|
119014
|
119079
|
119612
|
119613
|
119614
|
119615
|
119699
|
119700