Matt Domsch wrote:
It's stale on page refresh. Yesterday, I changed the name of a Site
using the web UI. I hit "submit", and the change is committed and the
page refreshed automatically. The Site name was unchanged (old value)
in the text box. I waited a few seconds, and reloaded the page, and
the Site name was changed to the new value.
In controller.py, Site.update() calls site.sync() at the end of the
update call, and the next call will be to Site.get() which should have
the new value you'd think.
Matt and I looked at this and we have a theory of what's going wrong as
well as a fix.
I tried to replicate this on publictest1 without success. When I tried
to replicate it on the app servers it returned stale data to me every
time. The theory is that since the app servers are alternating in
sending the page, we're ending up with this sequence of events:
1) app3 serves the site form.
2) User fills out form and submits
3) app4 processes the form results (including the call to site.sync())
and raises a redirect back to the form.
4) app3 gets the request and pulls the stale data out of its cache
because site.sync() wasn't called on this server.
I'm attaching a patch that invalidates the site cache before serving the
page. This should fix the stale cache but we'll have to check whether
it brings back the performance issues that require turning on the cache
in the first place. (It should be better than not having caching on at
all but it still might not be acceptable. Needs testing.)
Also, the other data on the forms probably needs to have similar calls
made to prevent stale data.
-Toshio
diff --git a/mirrors/mirrors/controllers.py b/mirrors/mirrors/controllers.py
index 2d07764..a33dda1 100644
--- a/mirrors/mirrors/controllers.py
+++ b/mirrors/mirrors/controllers.py
@@ -98,6 +98,7 @@ class SiteController(controllers.Controller, identity.SecureResource, content):
def get(self, id, tg_errors=None, tg_source=None, **kwargs):
site = Site.get(id)
+ site.expire()
site.sqlmeta.cacheValues = False
return dict(values=site, disabled_fields=self.disabled_fields(site=site))
_______________________________________________
Fedora-infrastructure-list mailing list
Fedora-infrastructure-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-infrastructure-list