[Koha-bugs] [Bug 13431] Shared FastMmap file causes issues

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 18 20:44:16 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13431

--- Comment #18 from Jacek Ablewicz <abl at biblos.pk.edu.pl> ---
(In reply to Chris Cormack from comment #16)

> > +use C4::Context;
> 
> We can't do this. We just added a big circular dependency if we do.
> 
> Because C4::Context uses Koha::Cache

Not in the current master (?), but it indeed will be used after bug 11998 (I
was under the impression that bug got already pushed). But it looks like this
line is not even necessary: in all places where Koha::Cache is used so far,
C4::Context is already loaded. Making such assumption is probably not very good
practice, but this code part (which includes database name etc. in the
sharefile name) is intended only as temporary (= until namespace configuration
issue gets dealt with properly) solution for severely misconfigured
multi-instance setups. So maybe we can live with that ;) if some extra
precautions will be taken (like putting that code part in the eval {} block +
some warn "Unable to determine database name due to .." maybe ?).

> @@ +162,5 @@
> >  sub _initialize_fastmmap {
> >      my ($self) = @_;
> > +    my $share_file = join( '-',
> > +        "/tmp/sharefile-koha", $self->{'namespace'},
> > +        C4::Context->config('hostname'), C4::Context->config('database'),
> 
> A better way to do this is is to change the places that call
> Koha::Cache->new()  
> To set the namespace. 
> 
> EG my $cache = Koha::Cache-new({cache_type => 'memcached_cache', namespace
> => C4::Context->config('hostname') . '-' .C4::Context->config('database')});

That would make Koha::Cache usage a bit inconvenient IMO, especially as
Koha::Cache->new() is currently never called outside of Koha::Cache itself,
Koha::Cache->get_instance() is always used instead.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list