Bugzilla – Attachment 107621 Details for
Bug 25292
L1 cache too long in Z3950 server (z3950-responder)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25292: Flushing L1 on every Z3950 server search
Bug-25292-Flushing-L1-on-every-Z3950-server-search.patch (text/plain), 1.78 KB, created by
Jonathan Druart
on 2020-07-31 08:52:15 UTC
(
hide
)
Description:
Bug 25292: Flushing L1 on every Z3950 server search
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-07-31 08:52:15 UTC
Size:
1.78 KB
patch
obsolete
>From 53bd6ff2ac80b2b0c4d4b3b1d5c598b9ae8d7f61 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 27 Apr 2020 16:25:32 +0200 >Subject: [PATCH] Bug 25292: Flushing L1 on every Z3950 server search > >This patch flushes the L1 cache on each Z3950 server search. > >There is no need to flush it in init_handler (when the connection is >made), the L1 cache is not accessed (this behaviour goes against what I >expected). > >This means each search will fetch values from the >L2 cache (ie memcached) and persist the L1 cache (in Perl >memory cache) until the result are returned (or longer?). > >Test plan: >% perl misc/z3950_responder.pl --config-dir=/kohadevbox/koha/etc/z3950 >% zoomsh >ZOOM>connect localhost:2100 >ZOOM>set databaseName biblios >ZOOM>search x >ZOOM>search x > >Between the 2 searches you can modify the value of SearchEngine, you >will notice that the number of hits is different >--- > Koha/Z3950Responder.pm | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/Koha/Z3950Responder.pm b/Koha/Z3950Responder.pm >index e074ba880e..4ab94eaec2 100644 >--- a/Koha/Z3950Responder.pm >+++ b/Koha/Z3950Responder.pm >@@ -24,6 +24,8 @@ use Modern::Perl; > use C4::Biblio qw( GetMarcFromKohaField ); > use C4::Koha qw( GetAuthorisedValues ); > >+use Koha::Caches; >+ > use Net::Z3950::SimpleServer; > > =head1 NAME >@@ -180,6 +182,12 @@ Callback that is called when a new search is performed > sub search_handler { > my ( $self, $args ) = @_; > >+ my $SearchEngine = C4::Context->preference('SearchEngine'); >+ # Flushing L1 to make sure the search will be processed using the correct data >+ Koha::Caches->flush_L1_caches(); >+ $self->init_handler($args) >+ if $SearchEngine ne C4::Context->preference('SearchEngine'); >+ > $args->{HANDLE}->search_handler($args); > } > >-- >2.20.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 25292
:
103795
|
107621
|
114436
|
114976