diff options
author | Joey Hess <joey@kitenet.net> | 2014-04-11 15:31:02 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-04-11 15:31:02 -0400 |
commit | 642ad22ed0adcf153128650b47762c57783fa67f (patch) | |
tree | f72fa720731df29337badea0e975d566c75868ee | |
parent | 1d6045f2b9a054e8442e5f74c3622a6526ce4350 (diff) | |
parent | 76c065c03bb13d4f12b33bf7c03577cfaa124211 (diff) |
Merge branch 'master' of ssh://git-annex.branchable.com
-rw-r--r-- | Utility/Scheduled.hs | 46 | ||||
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | doc/assistant/release_notes.mdwn | 5 | ||||
-rw-r--r-- | doc/bugs/assistant_eats_all_CPU.mdwn | 7 | ||||
-rw-r--r-- | doc/git-annex-shell.mdwn | 2 | ||||
-rw-r--r-- | git-annex.cabal | 2 |
6 files changed, 42 insertions, 28 deletions
diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs index 11e3b569b..2b7cae2b6 100644 --- a/Utility/Scheduled.hs +++ b/Utility/Scheduled.hs @@ -108,65 +108,65 @@ calcNextTime (Schedule recurrance scheduledtime) lasttime currenttime window startd endd = NextTimeWindow (LocalTime startd nexttime) (LocalTime endd (TimeOfDay 23 59 0)) - findfrom r afterday day = case r of + findfrom r afterday candidate = case r of Daily - | afterday -> Just $ exactly $ addDays 1 day - | otherwise -> Just $ exactly day + | afterday -> Just $ exactly $ addDays 1 candidate + | otherwise -> Just $ exactly candidate Weekly Nothing | afterday -> skip 1 - | otherwise -> case (wday <$> lastday, wday day) of - (Nothing, _) -> Just $ window day (addDays 6 day) + | otherwise -> case (wday <$> lastday, wday candidate) of + (Nothing, _) -> Just $ window candidate (addDays 6 candidate) (Just old, curr) - | old == curr -> Just $ window day (addDays 6 day) + | old == curr -> Just $ window candidate (addDays 6 candidate) | otherwise -> skip 1 Monthly Nothing | afterday -> skip 1 - | maybe True (\old -> mnum day > mday old && mday day >= (mday old `mod` minmday)) lastday -> + | maybe True (\old -> mnum candidate > mnum old && mday candidate >= (mday old `mod` minmday)) lastday -> -- Window only covers current month, -- in case there is a Divisible requirement. - Just $ window day (endOfMonth day) + Just $ window candidate (endOfMonth candidate) | otherwise -> skip 1 Yearly Nothing | afterday -> skip 1 - | maybe True (\old -> ynum day > ynum old && yday day >= (yday old `mod` minyday)) lastday -> - Just $ window day (endOfYear day) + | maybe True (\old -> ynum candidate > ynum old && yday candidate >= (yday old `mod` minyday)) lastday -> + Just $ window candidate (endOfYear candidate) | otherwise -> skip 1 Weekly (Just w) | w < 0 || w > maxwday -> Nothing - | w == wday day -> if afterday - then Just $ exactly $ addDays 7 day - else Just $ exactly day + | w == wday candidate -> if afterday + then Just $ exactly $ addDays 7 candidate + else Just $ exactly candidate | otherwise -> Just $ exactly $ - addDays (fromIntegral $ (w - wday day) `mod` 7) day + addDays (fromIntegral $ (w - wday candidate) `mod` 7) candidate Monthly (Just m) | m < 0 || m > maxmday -> Nothing -- TODO can be done more efficiently than recursing - | m == mday day -> if afterday + | m == mday candidate -> if afterday then skip 1 - else Just $ exactly day + else Just $ exactly candidate | otherwise -> skip 1 Yearly (Just y) | y < 0 || y > maxyday -> Nothing - | y == yday day -> if afterday + | y == yday candidate -> if afterday then skip 365 - else Just $ exactly day + else Just $ exactly candidate | otherwise -> skip 1 Divisible n r'@Daily -> handlediv n r' yday (Just maxyday) Divisible n r'@(Weekly _) -> handlediv n r' wnum (Just maxwnum) Divisible n r'@(Monthly _) -> handlediv n r' mnum (Just maxmnum) Divisible n r'@(Yearly _) -> handlediv n r' ynum Nothing - Divisible _ r'@(Divisible _ _) -> findfrom r' afterday day + Divisible _ r'@(Divisible _ _) -> findfrom r' afterday candidate where - skip n = findfrom r False (addDays n day) + skip n = findfrom r False (addDays n candidate) handlediv n r' getval mmax | n > 0 && maybe True (n <=) mmax = - findfromwhere r' (divisible n . getval) afterday day + findfromwhere r' (divisible n . getval) afterday candidate | otherwise = Nothing - findfromwhere r p afterday day + findfromwhere r p afterday candidate | maybe True (p . getday) next = next | otherwise = maybe Nothing (findfromwhere r p True . getday) next where - next = findfrom r afterday day + next = findfrom r afterday candidate getday = localDay . startTime divisible n v = v `rem` n == 0 diff --git a/debian/changelog b/debian/changelog index 00ac22c20..bd8273213 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -git-annex (5.20140406) UNRELEASED; urgency=medium +git-annex (5.20140411) unstable; urgency=medium * importfeed: Filename template can now contain an itempubdate variable. Needs feed 0.3.9.2. @@ -7,8 +7,12 @@ git-annex (5.20140406) UNRELEASED; urgency=medium OSX system has wget installed, which will then be used. * Fix rsync progress parsing in locales that use comma in number display. Closes: #744148 + * assistant: Fix high CPU usage triggered when a monthly fsck is scheduled, + and the last time the job ran was a day of the month > 12. This caused a + runaway loop. Thanks to Anarcat for his assistance, and to Maximiliano + Curia for identifying the cause of this bug. - -- Joey Hess <joeyh@debian.org> Mon, 07 Apr 2014 16:22:02 -0400 + -- Joey Hess <joeyh@debian.org> Fri, 11 Apr 2014 14:59:49 -0400 git-annex (5.20140405) unstable; urgency=medium diff --git a/doc/assistant/release_notes.mdwn b/doc/assistant/release_notes.mdwn index 7f13ce9e1..1ed622ba3 100644 --- a/doc/assistant/release_notes.mdwn +++ b/doc/assistant/release_notes.mdwn @@ -1,4 +1,7 @@ -## version 5.20140406 +## version 5.20140411 + +This release fixes a bug that could cause the assistant to use a *lot* of +CPU, when monthly fscking was set up. Automatic upgrading was broken on OSX for previous versions. This has been fixed, but you'll need to manually upgrade to this version to get it going diff --git a/doc/bugs/assistant_eats_all_CPU.mdwn b/doc/bugs/assistant_eats_all_CPU.mdwn index 4939bf456..719fca425 100644 --- a/doc/bugs/assistant_eats_all_CPU.mdwn +++ b/doc/bugs/assistant_eats_all_CPU.mdwn @@ -520,3 +520,10 @@ $ ps -O start xf | grep git-annex 13761 23:56:38 Z ? 00:00:00 \_ [git] <defunct> 6252 12:56:59 S ? 00:01:09 /usr/bin/emacs23 """]] + +#### This bug is fixed + +> [[fixed|done]]. This was a Cronner bug, triggered when you had a +> scheduled fsck job that runs monthly at any time, and the last time it ran was on a day of a +> month > 12. Workaround: Disable scheduled fsck jobs, or change them to +> run on a specific day of the month. Or upgrade. --[[Joey]] diff --git a/doc/git-annex-shell.mdwn b/doc/git-annex-shell.mdwn index eafb16468..26ccb9a40 100644 --- a/doc/git-annex-shell.mdwn +++ b/doc/git-annex-shell.mdwn @@ -67,7 +67,7 @@ first "/~/" or "/~user/" is expanded to the specified home directory. * notifychanges - This is used by `git-annex remote-daemon` to be notified when + This is used by `git-annex remotedaemon` to be notified when refs in the remote repository are changed. * gcryptsetup gcryptid diff --git a/git-annex.cabal b/git-annex.cabal index 59b7b3a59..ccbd14724 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20140405 +Version: 5.20140411 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess <joey@kitenet.net> |