Koha/misc
Julian Maurice 4b65d099d7 Bug 28276: Do not fetch config ($KOHA_CONF) from memcached
memcached address and namespace are in $KOHA_CONF, so it is required to
read it before being able to access the cache. And after that,
configuration is kept in memory forever. Storing this in memcached is
useless and even counter-productive, since Koha reads both the file and
the cache

This patch addresses this issue by removing the cache-related code from
C4::Context->new.
It means that C4::Context->new will always read the configuration file,
so this patch also replaces inappropriate calls to
C4::Context->new->config by appropriate calls to C4::Context->config

It also fixes a bug where C4::Context->new would ignore the filepath
given in parameters if there was something in cache.

It also removes a problematic call to Koha::Caches->get_instance.
Because this call was outside of any subroutine, it would have happened
before the initialization of $C4::Context::context (which happen in
C4::Context::import)

Test plan:
1. Do not apply the patch yet
2. Add the following line at the beginning of Koha::Config::read_from_file
    warn "read_from_file($file)";
   This will allow you to check how many times the file is read.
3. Flush memcached and restart starman
4. Check the logs, you should see "read_from_file" a bunch of times
5. Apply the patch
6. Re-add the line from step 2
7. Flush memcached and restart starman
8. Check the logs, you should see "read_from_file" only once
9. Make sure the memcached config from $KOHA_CONF (memcached_servers,
   memcached_namespace) is taken into account by checking the About page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-05-10 10:28:04 +02:00
..
admin
bin
cronjobs Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl 2021-04-28 11:16:14 +02:00
devel
interface_customization
load_testing
maintenance Bug 27963: (bug 23463 follow-up) Fix touch_all_items.pl 2021-04-01 17:13:56 +02:00
migration_tools Bug 24564: Use the same tab as the other subfields within a field 2021-05-10 10:27:51 +02:00
release_notes
search_tools Bug 26312: (follow-up) Fix passing of exception messages 2021-04-16 11:48:31 +02:00
translator Bug 28276: Do not fetch config ($KOHA_CONF) from memcached 2021-05-10 10:28:04 +02:00
add_date_fields_to_marc_records.pl
background_jobs_worker.pl Bug 27756: Fork background jobs to prevent memory leak 2021-05-07 14:44:00 +02:00
batchCompareMARCvsFrameworks.pl
batchdeletebiblios.pl
batchDeleteUnusedSubfields.pl
batchImportMARCWithBiblionumbers.pl
batchRebuildBiblioTables.pl
batchRebuildItemsTables.pl
batchRepairMissingBiblionumbers.pl
check_sysprefs.pl
commit_file.pl
export_borrowers.pl
export_records.pl
exportauth.pl
import_patrons.pl
koha-install-log
kohalib.pl
link_bibs_to_authorities.pl
load_yaml.pl
mod_zebraqueue.pl
perlmodule_ls.pl
perlmodule_rm.pl
recreateIssueStatistics.pl
sax_parser_print.pl
sax_parser_test.pl
sip_cli_emulator.pl Bug 26459: (follow-up) Clarify language and remove duplicated code 2021-04-07 16:08:04 +02:00
stage_file.pl
z3950_responder.pl