From 9e16171c7f9896567bc2b916c6b75949d1534e47 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Apr 2014 17:14:19 -0400 Subject: [PATCH 1/4] Last release didn't quite fix the high cpu issue in all cases, this should. This is supposed to look for a day past the last day it ran, not a month past. Seems to work, at least in anarcat's test case. --- Utility/Scheduled.hs | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs index 2b7cae2b65..45914aadad 100644 --- a/Utility/Scheduled.hs +++ b/Utility/Scheduled.hs @@ -121,7 +121,7 @@ calcNextTime (Schedule recurrance scheduledtime) lasttime currenttime | otherwise -> skip 1 Monthly Nothing | afterday -> skip 1 - | maybe True (\old -> mnum candidate > mnum old && mday candidate >= (mday old `mod` minmday)) lastday -> + | maybe True (\old -> mday candidate > mday old && mday candidate >= (mday old `mod` minmday)) lastday -> -- Window only covers current month, -- in case there is a Divisible requirement. Just $ window candidate (endOfMonth candidate) diff --git a/debian/changelog b/debian/changelog index 0c0bfafdba..c3952f28f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (5.20140412) UNRELEASED; urgency=high + + * Last release didn't quite fix the high cpu issue in all cases, this should. + + -- Joey Hess Fri, 11 Apr 2014 17:13:07 -0400 + git-annex (5.20140411) unstable; urgency=high * importfeed: Filename template can now contain an itempubdate variable. From e26dead493a4122f84125c8a6da00180e0430fb9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Apr 2014 18:08:46 -0400 Subject: [PATCH 2/4] guard against any remaining infinite recursion bugs; throw error if no candidate cn be found in next hundred years Note that the exception thrown is not visible in the webapp currently because it crashes one of Cronner's 2 worker threads, which is never checked. --- Utility/Scheduled.hs | 10 ++++++++-- debian/changelog | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs index 45914aadad..1b25cb4c70 100644 --- a/Utility/Scheduled.hs +++ b/Utility/Scheduled.hs @@ -86,7 +86,7 @@ nextTime schedule lasttime = do {- Calculate the next time that fits a Schedule, based on the - last time it occurred, and the current time. -} calcNextTime :: Schedule -> Maybe LocalTime -> LocalTime -> Maybe NextTime -calcNextTime (Schedule recurrance scheduledtime) lasttime currenttime +calcNextTime schedule@(Schedule recurrance scheduledtime) lasttime currenttime | scheduledtime == AnyTime = do next <- findfromtoday True return $ case next of @@ -108,7 +108,13 @@ calcNextTime (Schedule recurrance scheduledtime) lasttime currenttime window startd endd = NextTimeWindow (LocalTime startd nexttime) (LocalTime endd (TimeOfDay 23 59 0)) - findfrom r afterday candidate = case r of + findfrom r afterday candidate + | ynum candidate > (ynum (localDay currenttime)) + 100 = + -- avoid possible infinite recusion + error $ "bug: calcNextTime did not find a time within 100 years to run " ++ + show (schedule, lasttime, currenttime) + | otherwise = findfromChecked r afterday candidate + findfromChecked r afterday candidate = case r of Daily | afterday -> Just $ exactly $ addDays 1 candidate | otherwise -> Just $ exactly candidate diff --git a/debian/changelog b/debian/changelog index c3952f28f3..a883ddda92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -git-annex (5.20140412) UNRELEASED; urgency=high +git-annex (5.20140412) unstable; urgency=high * Last release didn't quite fix the high cpu issue in all cases, this should. - -- Joey Hess Fri, 11 Apr 2014 17:13:07 -0400 + -- Joey Hess Fri, 11 Apr 2014 17:14:38 -0400 git-annex (5.20140411) unstable; urgency=high From 2503f433dc2897bff627e7af25f9554a494f1491 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Apr 2014 18:10:10 -0400 Subject: [PATCH 3/4] prep release --- git-annex.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-annex.cabal b/git-annex.cabal index ccbd14724a..855fecd5a6 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20140411 +Version: 5.20140412 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess From da795e0843ccdf9c1f24381780f84ec158558c3b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Apr 2014 18:29:48 -0400 Subject: [PATCH 4/4] add news item for git-annex 5.20140412 --- doc/news/version_5.20140306.mdwn | 34 -------------------------------- doc/news/version_5.20140412.mdwn | 3 +++ 2 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 doc/news/version_5.20140306.mdwn create mode 100644 doc/news/version_5.20140412.mdwn diff --git a/doc/news/version_5.20140306.mdwn b/doc/news/version_5.20140306.mdwn deleted file mode 100644 index ef302495b9..0000000000 --- a/doc/news/version_5.20140306.mdwn +++ /dev/null @@ -1,34 +0,0 @@ -git-annex 5.20140306 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * sync: Fix bug in direct mode that caused a file that was not - checked into git to be deleted when there was a conflicting - merge with a remote. - * webapp: Now supports HTTPS. - * webapp: No longer supports a port specified after --listen, since - it was buggy, and that use case is better supported by setting up HTTPS. - * annex.listen can be configured, instead of using --listen - * annex.startupscan can be set to false to disable the assistant's startup - scan. - * Probe for quvi version at run time. - * webapp: Filter out from Switch Repository list any - repositories listed in autostart file that don't have a - git directory anymore. (Or are bare) - * webapp: Refuse to start in a bare git repository. - * assistant --autostart: Refuse to start in a bare git repository. - * webapp: Don't list the public repository group when editing a - git repository; it only makes sense for special remotes. - * view, vfilter: Add support for filtering tags and values out of a view, - using !tag and field!=value. - * vadd: Allow listing multiple desired values for a field. - * view: Refuse to enter a view when no branch is currently checked out. - * metadata: To only set a field when it's not already got a value, use - -s field?=value - * Run .git/hooks/pre-commit-annex whenever a commit is made. - * sync: Automatically resolve merge conflict between and annexed file - and a regular git file. - * glacier: Pass --region to glacier checkpresent. - * webdav: When built with a new enough haskell DAV (0.6), disable - the http response timeout, which was only 5 seconds. - * webapp: Include no-pty in ssh authorized\_keys lines. - * assistant: Smarter log file rotation, which takes free disk space - into account."""]] \ No newline at end of file diff --git a/doc/news/version_5.20140412.mdwn b/doc/news/version_5.20140412.mdwn new file mode 100644 index 0000000000..7e9267a613 --- /dev/null +++ b/doc/news/version_5.20140412.mdwn @@ -0,0 +1,3 @@ +git-annex 5.20140412 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Last release didn't quite fix the high cpu issue in all cases, this should."""]] \ No newline at end of file