diff options
-rw-r--r-- | Utility/CoProcess.hs | 2 | ||||
-rw-r--r-- | Utility/Process.hs | 34 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/bugs/windows_port_-_git_annex_add_hangs_when_adding_17_files_at_once_or_more_.mdwn | 15 |
4 files changed, 35 insertions, 17 deletions
diff --git a/Utility/CoProcess.hs b/Utility/CoProcess.hs index 534229d51..ec24c4dcc 100644 --- a/Utility/CoProcess.hs +++ b/Utility/CoProcess.hs @@ -43,7 +43,7 @@ start restartable cmd params env = do start' :: CoProcessSpec -> IO CoProcessState start' s = do - (to, from, _err, pid) <- runInteractiveProcess (coProcessCmd s) (coProcessParams s) Nothing (coProcessEnv s) + (pid, to, from) <- startInteractiveProcess (coProcessCmd s) (coProcessParams s) (coProcessEnv s) return $ CoProcessState pid to from s stop :: CoProcessHandle -> IO () diff --git a/Utility/Process.hs b/Utility/Process.hs index cee727656..ecd42a98e 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -26,7 +26,7 @@ module Utility.Process ( withBothHandles, withQuietOutput, createProcess, - runInteractiveProcess, + startInteractiveProcess, stdinHandle, stdoutHandle, stderrHandle, @@ -34,7 +34,7 @@ module Utility.Process ( import qualified System.Process import System.Process as X hiding (CreateProcess(..), createProcess, runInteractiveProcess, readProcess, readProcessWithExitCode, system, rawSystem, runInteractiveCommand, runProcess) -import System.Process hiding (createProcess, runInteractiveProcess, readProcess) +import System.Process hiding (createProcess, readProcess) import System.Exit import System.IO import System.Log.Logger @@ -300,17 +300,19 @@ createProcess p = do debugProcess p System.Process.createProcess p -runInteractiveProcess - :: FilePath - -> [String] - -> Maybe FilePath - -> Maybe [(String, String)] - -> IO (Handle, Handle, Handle, ProcessHandle) -runInteractiveProcess f args c e = do - debugProcess $ (proc f args) - { std_in = CreatePipe - , std_out = CreatePipe - , std_err = CreatePipe - , env = e - } - System.Process.runInteractiveProcess f args c e +{- Starts an interactive process. Unlike runInteractiveProcess in + - System.Process, stderr is inherited. -} +startInteractiveProcess + :: FilePath + -> [String] + -> Maybe [(String, String)] + -> IO (ProcessHandle, Handle, Handle) +startInteractiveProcess cmd args environ = do + let p = (proc cmd args) + { std_in = CreatePipe + , std_out = CreatePipe + , std_err = Inherit + , env = environ + } + (Just from, Just to, _, pid) <- createProcess p + return (pid, to, from) diff --git a/debian/changelog b/debian/changelog index be6a5798d..4cf933cad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,7 @@ git-annex (4.20130602) UNRELEASED; urgency=low with git annex sync or by the assistant. * Android: Fix use of cp command to not try to use features present only on build system. + * Windows: Fix hang when adding several files at once. -- Joey Hess <joeyh@debian.org> Mon, 10 Jun 2013 12:52:44 -0400 diff --git a/doc/bugs/windows_port_-_git_annex_add_hangs_when_adding_17_files_at_once_or_more_.mdwn b/doc/bugs/windows_port_-_git_annex_add_hangs_when_adding_17_files_at_once_or_more_.mdwn index 04d3449c0..50f020b19 100644 --- a/doc/bugs/windows_port_-_git_annex_add_hangs_when_adding_17_files_at_once_or_more_.mdwn +++ b/doc/bugs/windows_port_-_git_annex_add_hangs_when_adding_17_files_at_once_or_more_.mdwn @@ -180,3 +180,18 @@ info"] # End of transcript or log. """]] + +> Reproduced this, and git update-index was in fact not hanging. +> Instead, after that was done, it tried to stop the git hash-object +> process, and this hung. +> +> It seems that the use of runInteractiveProcess is at fault somehow, +> and I guess it must be due to it opening a pipe for stderr, which +> I don't need or want. Perhaps I need to ensure I read from that pipe, +> or windows keeps the process from terminating. (Unix would just toss the piped +> data away.) +> +> That was the only place runInteractiveProcess was used, so I replaced +> it with an alternative that lets stderr be inherited. With this change, +> I have successfully added 1000 files to the annex in one go, with no +> hang. Provisionally [[done]]. --[[Joey]] |