]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* In the cgi edit path, reload the index file before rendering. A bug
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 10 Oct 2007 18:40:54 +0000 (18:40 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 10 Oct 2007 18:40:54 +0000 (18:40 +0000)
  showed up where a web edit that added a page caused a near-concurrent
  web edit to fail in will_render. While it would be hard to reproduce this,
  my analysis is that the failing cgi started first, loaded the index file
  (prior to locking) then the other cgi created the new page and rendered
  it, and then the failing cgi choked on the new file when _it_ tried to
  render it. Ensuring that the index file is loaded after taking the lock
  will avoid this bug.

IkiWiki/CGI.pm
debian/changelog

index 155010a97e6d606a1fff8af7b85ff93aef8fc0f5..788d0487e1012d3d6fe4dd8359200e99bf186e15 100644 (file)
@@ -596,6 +596,10 @@ sub cgi_editpage ($$) { #{{{
                # may have been committed while the post-commit hook was
                # disabled.
                require IkiWiki::Render;
+               # Reload index, since the first time it's loaded is before
+               # the wiki is locked, and things may have changed in the
+               # meantime.
+               loadindex();
                refresh();
                saveindex();
 
index ba24beee91bcf26d568e897baf4dd7b86346fa07..138412216fffaeeb9aa4cea71cf3294501161063 100644 (file)
@@ -3,8 +3,16 @@ ikiwiki (2.10) UNRELEASED; urgency=low
   * Tidy ctime debug output for git.
   * French translation update. Closes: #445923
   * Fix --get-ctime with git, needed to remove srcdir from filename.
-
- -- Joey Hess <joeyh@debian.org>  Wed, 10 Oct 2007 14:14:18 -0400
+  * In the cgi edit path, reload the index file before rendering. A bug
+    showed up where a web edit that added a page caused a near-concurrent
+    web edit to fail in will_render. While it would be hard to reproduce this,
+    my analysis is that the failing cgi started first, loaded the index file
+    (prior to locking) then the other cgi created the new page and rendered
+    it, and then the failing cgi choked on the new file when _it_ tried to
+    render it. Ensuring that the index file is loaded after taking the lock
+    will avoid this bug.
+
+ -- Joey Hess <joeyh@debian.org>  Wed, 10 Oct 2007 14:36:38 -0400
 
 ikiwiki (2.9) unstable; urgency=low