#613: Add / remove milestone breaks a whole product
---------------------------+-----------------------------------------------
Reporter: olemis | Owner: nobody
Type: defect | Status: new
Priority: blocker | Milestone: next 0.x
Component: multiproduct | Version: 0.6.0
Resolution: | Keywords: milestone, postgresql, db, sqlite
---------------------------+-----------------------------------------------
Comment (by gjm):
Replying to [comment:17 wimh]:
> I can "fix" this problem if I modify the apache2 virtual host definition
for bh, and add {{{processes=1 threads=1}}} to the line containing
{{{WSGIDaemonProcess}}}. If I set either value to 2, the problem
reappears. I assume this fix is bad for performance, in particular on
multi-core servers.
>
> I don't know much about WSGI, but I found this document with some
related info: https://code.google.com/p/modwsgi/wiki/ProcessesAndThreading
>
Yes, this is correct. It is possible to deal with in this way although I
have been reluctant to advise on that when there should be a better
solution.
I have added a unit test that demonstrates the problem making use of
threads in r1609909. One solution to this is to drop the lru_cache
decorator from
source:trunk/bloodhound_multiproduct/multiproduct/env.py#L386 which seems
to interact badly with the pre-existing caching that milestones have.
The alternative that I am currently looking at is to clear the cache close
to the beginning of a request with:
{{{#!diff
Index: bloodhound_multiproduct/multiproduct/env.py
===================================================================
--- bloodhound_multiproduct/multiproduct/env.py (revision 1611839)
+++ bloodhound_multiproduct/multiproduct/env.py (working copy)
@@ -365,6 +365,8 @@
g_env = env.parent if isinstance(env,
ProductEnvironment) else
env
return f(self, g_env, *args, **kwargs)
+ __call__.clear = f.clear
+
return __call__
def product_env_keymap(args, kwds, kwd_mark):
@@ -397,6 +399,10 @@
setup_participants =
ExtensionPoint(trac.env.IEnvironmentSetupParticipant)
multi_product_support_components =
ExtensionPoint(ISupportMultiProductEnvironment)
+ @classmethod
+ def clear_env_cache(cls):
+ cls.__metaclass__.__call__.clear()
+
@property
def product_setup_participants(self):
return [
Index: bloodhound_multiproduct/multiproduct/hooks.py
===================================================================
--- bloodhound_multiproduct/multiproduct/hooks.py (revision 1611839)
+++ bloodhound_multiproduct/multiproduct/hooks.py (working copy)
@@ -37,6 +37,7 @@
class MultiProductEnvironmentFactory(EnvironmentFactoryBase):
def open_environment(self, environ, env_path, global_env,
use_cache=False):
+ multiproduct.env.ProductEnvironment.clear_env_cache()
environ.setdefault('SCRIPT_NAME', '') # bh:ticket:594
env = pid = product_path = None
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/613#comment:18>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker