Bug 31614 - Add configurable timeout for Zebra connections
Summary: Add configurable timeout for Zebra connections
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Zebra (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: David Cook
QA Contact: Kyle M Hall
URL:
Keywords:
: 17123 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-09-23 02:57 UTC by David Cook
Modified: 2023-12-28 20:42 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 31614: Adds a koha-conf.xml config to set Zebra connection timeout (3.25 KB, patch)
2022-09-23 03:31 UTC, David Cook
Details | Diff | Splinter Review
Bug 31614: Adds a koha-conf.xml config to set Zebra connection timeout (3.30 KB, patch)
2022-09-23 21:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 31614: Adds a koha-conf.xml config to set Zebra connection timeout (3.35 KB, patch)
2022-10-07 15:32 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2022-09-23 02:57:53 UTC
Zebra searches that take 30+ seconds will return 0 records to Koha, because the ZOOM connection has an I/O timeout that defaults to 30 seconds.
Comment 1 David Cook 2022-09-23 02:58:30 UTC
Ideally, your search wouldn't take longer than 30 seconds, but if you do a weighted search that includes a stopword in a database of over 1,000,000 records... it's not uncommon to have this problem.
Comment 2 David Cook 2022-09-23 03:31:43 UTC
Created attachment 140881 [details] [review]
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
Comment 3 David Nind 2022-09-23 21:09:05 UTC
Created attachment 140965 [details] [review]
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

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Kyle M Hall 2022-10-07 15:32:54 UTC
Created attachment 141516 [details] [review]
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

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi 2022-10-12 12:46:52 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 David Cook 2022-12-06 05:37:29 UTC
*** Bug 17123 has been marked as a duplicate of this bug. ***