Bugzilla – Attachment 140881 Details for
Bug 31614
Add configurable timeout for Zebra connections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31614: Adds a koha-conf.xml config to set Zebra connection timeout
Bug-31614-Adds-a-koha-confxml-config-to-set-Zebra-.patch (text/plain), 3.25 KB, created by
David Cook
on 2022-09-23 03:31:43 UTC
(
hide
)
Description:
Bug 31614: Adds a koha-conf.xml config to set Zebra connection timeout
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-09-23 03:31:43 UTC
Size:
3.25 KB
patch
obsolete
>From 2bf1dc73ca8c259ff823ad7f8858ac191327255d Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Fri, 23 Sep 2022 03:21:08 +0000 >Subject: [PATCH] Bug 31614: Adds a koha-conf.xml config to set Zebra > connection timeout > >This patch adds <zebra_connection_timeout>30</zebra_connection_timeout> >to the koha-conf.xml file. > >Sometimes, a Zebra search might take longer than 30 seconds. If it does, >Koha will say that 0 records have been found. While slow searching >is not desirable, it's more desirable to get the result set regardless. > >Test plan: >0. Apply patch >1. Add <zebra_connection_timeout>.1</zebra_connection_timeout> to >your relevant koha-conf.xml file (e.g. /etc/koha/sites/kohadev/koha-conf.xml) >2. echo 'flush_all' | nc -q 1 memcached 11211 >3. koha-plack --restart kohadev >4. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test >5. Note that no results are returned >6. Change zebra_connection_timeout to 30 >7. echo 'flush_all' | nc -q 1 memcached 11211 >8. koha-plack --restart kohadev >9a. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test >9b. Note that 3 results are returned >10. Remove zebra_connection_timeout from koha-conf.xml >11. echo 'flush_all' | nc -q 1 memcached 11211 >12. koha-plack --restart kohadev >13a. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test >13b. Note that 3 results are returned >14. Celebrate >--- > C4/Context.pm | 2 ++ > debian/templates/koha-conf-site.xml.in | 1 + > etc/koha-conf.xml | 1 + > 3 files changed, 4 insertions(+) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 8cd7681e6c..34418f365b 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -567,6 +567,8 @@ sub _new_Zconn { > $o->option(preferredRecordSyntax => $syntax); > $o->option(elementSetName => $elementSetName) if $elementSetName; > $o->option(databaseName => _common_config($server, 'config') || 'biblios'); >+ my $timeout = C4::Context->config('zebra_connection_timeout') || 30; >+ $o->option(timeout => $timeout); > > # create a new connection object > $Zconn= create ZOOM::Connection($o); >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index bcf6bab0f6..bdb994c517 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -291,6 +291,7 @@ __END_SRU_PUBLICSERVER__ > <lockdir>/var/lock/koha/__KOHASITE__</lockdir> > <use_zebra_facets>1</use_zebra_facets> > <zebra_max_record_size>1024</zebra_max_record_size> >+ <zebra_connection_timeout>30</zebra_connection_timeout> > <log4perl_conf>__KOHA_CONF_DIR__/log4perl.conf</log4perl_conf> > <!-- Uncomment/edit next setting if you want to adjust zebra log levels. > Default is: none,fatal,warn. >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 793420437d..3e5623cb96 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -108,6 +108,7 @@ > <lockdir>__LOCK_DIR__</lockdir> > <use_zebra_facets>1</use_zebra_facets> > <zebra_max_record_size>1024</zebra_max_record_size> >+ <zebra_connection_timeout>30</zebra_connection_timeout> > <log4perl_conf>__KOHA_CONF_DIR__/log4perl.conf</log4perl_conf> > <!-- Uncomment/edit next setting if you want to adjust zebra log levels. > Default is: none,fatal,warn. >-- >2.25.1
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 31614
:
140881
|
140965
|
141516