git-annex/Utility
Joey Hess d9d76cf98b Fix minor FD leak in journal code.
Minor because normally only 1 FD is leaked per git-annex run. However,
the test suite leaks a few hundred FDs, and this broke it on the Debian
autobuilders, which seem to have a tigher than usual ulimit.

The leak was introduced by the lazy getDirectoryContents' that was
introduced in e6330988dd in order to scale to
millions of journal files -- if the lazy list was never fully consumed, the
directory handle did not get closed.

Instead, pull in openDirectory/readDirectory/closeDirectory code that I
already developed and submitted in a patch to the haskell directory library
earlier. Using this in journalDirty avoids the place that the lazy list
caused a problem. And using it in stageJournal eliminates the need for
getDirectoryContents'.

The getJournalFiles* functions are switched back to using the regular
strict getDirectoryContents. I'm not sure if those always consume the whole
list, so this avoids any leak. And the things that call those are things
like git annex unused, which also look at every file committed to the
git-annex branch, so would need more work to scale to insane numbers of
files anyway.
2014-07-09 23:36:53 -04:00
..
DirWatcher relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Applicative.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Base64.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Batch.hs export CreateProcess fields from Utility.Process 2014-06-10 19:20:14 -04:00
Bloom.hs Support building with bloomfilter 2.0.0. 2014-07-07 12:24:12 -04:00
CoProcess.hs export CreateProcess fields from Utility.Process 2014-06-10 19:20:14 -04:00
CopyFile.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Daemon.hs Ignore setsid failures. 2014-06-09 14:44:18 -04:00
Data.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
DataUnits.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
DBus.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Directory.hs Fix minor FD leak in journal code. 2014-07-09 23:36:53 -04:00
DirWatcher.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
DiskFree.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Dot.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Env.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Exception.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
ExternalSHA.hs export CreateProcess fields from Utility.Process 2014-06-10 19:20:14 -04:00
FileMode.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
FileSystemEncoding.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Format.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
FreeDesktop.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Glob.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Gpg.hs hlint 2014-04-26 19:25:05 -04:00
Hash.hs lazy bytestring fromStrict is not available in stable; use fromChunks instead 2014-05-29 20:25:01 -04:00
HumanNumber.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
HumanTime.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
InodeCache.hs finish fixing windows timezone madness 2014-06-12 13:54:08 -04:00
JSONStream.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
libdiskfree.c relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
libdiskfree.h Renamed diskfree.c to avoid OSX case insensativity bug. 2012-04-13 11:26:39 -04:00
libkqueue.c relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
libkqueue.h fix prototype 2012-06-19 01:57:19 -04:00
libmounts.c cleanup 2012-07-19 21:20:38 -04:00
libmounts.h Got removable media mount detection working on Android. 2013-05-04 16:19:25 -04:00
LinuxMkLibs.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
LogFile.hs Windows: Assistant now logs to daemon.log. 2014-06-17 19:27:54 -04:00
Lsof.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Matcher.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Metered.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Misc.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Monad.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Mounts.hsc avoid warnings when built with ghc 7.6 2013-06-02 15:01:58 -04:00
Network.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
NotificationBroadcaster.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
OSX.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Parallel.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
PartialPrelude.hs rename readMaybe to readish 2012-01-23 17:00:10 -04:00
Path.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Percentage.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
PID.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
PosixFiles.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Process.hs export CreateProcess fields from Utility.Process 2014-06-10 19:20:14 -04:00
QuickCheck.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Quvi.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Rsync.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
SafeCommand.hs export CreateProcess fields from Utility.Process 2014-06-10 19:20:14 -04:00
Scheduled.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Shell.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
SimpleProtocol.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
SRV.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
SshConfig.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Tense.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
ThreadLock.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
ThreadScheduler.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
TList.hs comment 2014-01-07 17:33:38 -04:00
Tmp.hs Avoid leaving behind .tmp files when failing in some cases, including importing files to a disk that is full. 2014-06-09 15:24:05 -04:00
Touch.hsc relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
URI.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Url.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
UserInfo.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Verifiable.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
WebApp.hs Fix build with wai 0.3.0. 2014-06-11 01:29:00 -04:00
WinLock.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
winprocess.c windows: Fix process termination code. 2014-02-13 15:53:10 -04:00
WinProcess.hs relicense general utility library code to BSD 2014-05-10 11:01:27 -03:00
Yesod.hs create a local copy of Yesod.Form.Bootstrap3 2014-04-25 12:26:33 +02:00