About Download Docs Changes

Updating menu when running multiple wsgi processes

I configured Apache like this:

  WSGIDaemonProcess website.example processes=2 threads=15 display-name=%{GROUP}

(taken directly from the quick introduction to mod_wsgi).

If I change the Menu, and then browse the site, sometimes the menu reflects the changes, sometimes it doesn't.

If I reload a page it jumps back and forth between the changed and unchanged menu.

My guess is that each process caches the content of Menu and when it is changed, only the process that gets the POST updates its cache. Or something, just a wild guess.

Let me know if you can't reproduce it. –asjo


You re right, the backlinks are kept in a shelve file in cache. That file is cached for efficiency of reading. I guess I will have to either check the modification date of the file each time a page is displayed, or use some mechanism like inotify… I will have to think about it, thanks for your effort. – Radomir Dopieralski

Workaround

Touch the hatta.wsgi file to cause restarting of the wsgi processes and thus clearing the cache.


Cool. I guess another workaround that will work for my small instance is to just only have one process, right? –asjo

Fixed

This is fixed in the most recent development version – I remember the last modification date of the file in which page's links are cached, and re-read it if it changed. This means one more stat call every time you check the list of links of a page – at the moment only when a menu is displayed, so it's not much. I'm probably overoptimizing here anyways. – Radomir Dopieralski


Fixed Bugs