From 11d377af816b30eba336fae2993a79362443c293 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Nov 2008 20:49:18 -0500 Subject: txt: Do not encode quotes when filtering the txt, as that broke later parsing of any directives on the page. --- po/ikiwiki.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'po') diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 5db0c51af..6894dd2f6 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-03 16:31-0500\n" +"POT-Creation-Date: 2008-11-06 20:47-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -120,7 +120,7 @@ msgstr "" msgid "feed crashed XML::Feed!" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:590 +#: ../IkiWiki/Plugin/aggregate.pm:591 #, perl-format msgid "creating new page %s" msgstr "" -- cgit v1.2.3 From fb89bfd26bc248b8ce7c21446512b78b9ecb3391 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 Nov 2008 12:22:01 -0500 Subject: document wikistatedir, though it's still internal --- IkiWiki.pm | 9 ++++++++- po/ikiwiki.pot | 14 +++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'po') diff --git a/IkiWiki.pm b/IkiWiki.pm index 91d2e6082..1aaa4d33c 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -403,6 +403,13 @@ sub getsetup () { #{{{ safe => 0, rebuild => 0, }, + wikistatedir => { + type => "internal", + default => undef, + description => "path to the .ikiwiki directory holding ikiwiki state", + safe => 0, + rebuild => 0, + }, setupfile => { type => "internal", default => undef, @@ -467,7 +474,7 @@ sub checkconfig () { #{{{ } $config{wikistatedir}="$config{srcdir}/.ikiwiki" - unless exists $config{wikistatedir}; + unless exists $config{wikistatedir} && defined $config{wikistatedir}; if (defined $config{umask}) { umask(possibly_foolish_untaint($config{umask})); diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 6894dd2f6..34fa5e65b 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-06 20:47-0500\n" +"POT-Creation-Date: 2008-11-07 12:23-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -48,7 +48,7 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1182 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1189 msgid "Error" msgstr "" @@ -951,25 +951,25 @@ msgstr "" msgid "refreshing wiki.." msgstr "" -#: ../IkiWiki.pm:466 +#: ../IkiWiki.pm:473 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" -#: ../IkiWiki.pm:512 +#: ../IkiWiki.pm:519 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:541 +#: ../IkiWiki.pm:548 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1165 +#: ../IkiWiki.pm:1172 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1678 +#: ../IkiWiki.pm:1685 msgid "yes" msgstr "" -- cgit v1.2.3 From d1b22b252481134815b1d02d564b6b9622fe7b4b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Nov 2008 15:54:52 -0500 Subject: lockwiki changes * Stop busy-waiting in lockwiki, as this could delay ikiwiki from waking up for up to one second. The bailout code is no longer needed. * Remove support for unused optional wait parameter from lockwiki. --- IkiWiki.pm | 19 +++---------------- debian/changelog | 8 ++++++++ doc/todo/avoid_thrashing.mdwn | 2 ++ po/ikiwiki.pot | 10 +++++----- 4 files changed, 18 insertions(+), 21 deletions(-) (limited to 'po') diff --git a/IkiWiki.pm b/IkiWiki.pm index dc9b66344..d949566d8 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1280,8 +1280,7 @@ sub indexlink () { #{{{ my $wikilock; -sub lockwiki (;$) { #{{{ - my $wait=@_ ? shift : 1; +sub lockwiki () { #{{{ # Take an exclusive lock on the wiki to prevent multiple concurrent # run issues. The lock will be dropped on program exit. if (! -d $config{wikistatedir}) { @@ -1289,20 +1288,8 @@ sub lockwiki (;$) { #{{{ } open($wikilock, '>', "$config{wikistatedir}/lockfile") || error ("cannot write to $config{wikistatedir}/lockfile: $!"); - if (! flock($wikilock, 2 | 4)) { # LOCK_EX | LOCK_NB - if ($wait) { - debug("wiki seems to be locked, waiting for lock"); - my $wait=600; # arbitrary, but don't hang forever to - # prevent process pileup - for (1..$wait) { - return if flock($wikilock, 2 | 4); - sleep 1; - } - error("wiki is locked; waited $wait seconds without lock being freed (possible stuck process or stale lock?)"); - } - else { - return 0; - } + if (! flock($wikilock, 2)) { # LOCK_EX + error("failed to get lock"); } return 1; } #}}} diff --git a/debian/changelog b/debian/changelog index dfc5de2d4..2088b07ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,14 @@ ikiwiki (2.69) UNRELEASED; urgency=low * tag: Normalize tagbase so leading/trailing slashes in it don't break things. * bzr: Fix dates for recentchanges. + * Avoid multiple ikiwiki cgi processes piling up, eating all memory, + and thrashing, by making the cgi wrapper wait on a cgilock. + If you had to set apache's MaxClients low to avoid ikiwiki thrashing your + server, you can now turn it up to a high value. + * Stop busy-waiting in lockwiki, as this could delay ikiwiki from waking up + for up to one second. The bailout code is no longer needed after above + change. + * Remove support for unused optional wait parameter from lockwiki. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 diff --git a/doc/todo/avoid_thrashing.mdwn b/doc/todo/avoid_thrashing.mdwn index 6c895e7c9..45b11d872 100644 --- a/doc/todo/avoid_thrashing.mdwn +++ b/doc/todo/avoid_thrashing.mdwn @@ -18,3 +18,5 @@ with no ill effects. Crank `MaxClients` up to 256? No problem.. And there's no real reason to allow more than one ikiwiki cgi to run at a time. Since almost all uses of the CGI lock the index, only one can really be doing anything at a time. --[[Joey]] + +[[done]] diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 34fa5e65b..8cf3853e0 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-07 12:23-0500\n" +"POT-Creation-Date: 2008-11-11 15:36-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -910,19 +910,19 @@ msgstr "" #. translators: The first parameter is a filename, and the second is #. translators: a (probably not translated) error message. -#: ../IkiWiki/Wrapper.pm:79 +#: ../IkiWiki/Wrapper.pm:93 #, perl-format msgid "failed to write %s: %s" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:135 +#: ../IkiWiki/Wrapper.pm:150 #, perl-format msgid "failed to compile %s" msgstr "" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:155 +#: ../IkiWiki/Wrapper.pm:170 #, perl-format msgid "successfully generated %s" msgstr "" @@ -969,7 +969,7 @@ msgstr "" msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1685 +#: ../IkiWiki.pm:1672 msgid "yes" msgstr "" -- cgit v1.2.3