Bugzilla – Attachment 68469 Details for
Bug 19523
Koha::Cache changes not passed to all plack workers with in-memory caching.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19523 - Koha::Cache changes not passed to all plack workers with in-memory caching.
Bug-19523---KohaCache-changes-not-passed-to-all-pl.patch (text/plain), 1.88 KB, created by
Olli-Antti Kivilahti
on 2017-10-24 13:51:06 UTC
(
hide
)
Description:
Bug 19523 - Koha::Cache changes not passed to all plack workers with in-memory caching.
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2017-10-24 13:51:06 UTC
Size:
1.88 KB
patch
obsolete
>From 318a1913807b5de2a95d412da4235aad0c45acb9 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Tue, 24 Oct 2017 16:50:32 +0300 >Subject: [PATCH] Bug 19523 - Koha::Cache changes not passed to all plack > workers with in-memory caching. > >REPRODUCE: > >- $KOHA_CONF shouldn't have any <memcached_* -definitions. This triggers in-memory cache usage. >- plack workers is atleast 2 >- Change some easily visible syspref, such as 'languages'. The syspref change applies only to the worker thread where the change was made. Other worker threads keep using the old syspref. >- Observe that 50% of time the old syspref is used. Other times the new syspref is used. >- Reduce plack workers to 1. Observe no issues with syspref change taking effect. > >Using memcached solves this problem. > >It is still useful to fix it for those who don't want to use memcached. >--- > misc/plack/plack.psgi | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/misc/plack/plack.psgi b/misc/plack/plack.psgi >index a9c7313..9c94f87 100644 >--- a/misc/plack/plack.psgi >+++ b/misc/plack/plack.psgi >@@ -47,7 +47,14 @@ use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise > *CGI::new = sub { > my $q = $old_new->( @_ ); > $CGI::PARAM_UTF8 = 1; >- Koha::Caches->flush_L1_caches(); >+ >+ my $syspref_cache = Koha::Caches->get_instance('syspref'); >+ if ($syspref_cache->{'memcached_cache'}) { #When using a shared caching medium, cache invalidations can be communicated between workers. >+ Koha::Caches->flush_L1_caches(); >+ } >+ else { #Without a shared cache medium, workers cannot invalidate cached values in each others memory, if for. ex. a syspref is changed. >+ Koha::Caches->flush(); #Then we must flush all caches periodically. >+ } > Koha::Cache::Memory::Lite->flush(); > return $q; > }; >-- >2.7.4
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 19523
: 68469 |
69325