From b6642dde8a49f34d7983a40e99bf7032a731c964 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 16 Sep 2020 12:10:45 -0400 Subject: [PATCH] avoid interleaving command stages with Concurrency 1 Before, -J1 was different than no -J: It makes concurrent-output be used for display, and it actually can run concurrent jobs in some situations. Eg, a perform stage and a cleanup stage can both run. dupState is used in several places, and changes NonConcurrent to Concurrent 1. My concern is that this might, in some case, enable that concurrent behavior. And in particular, that it might get enabled in --batch mode, when the user is not expecting concurrent output because they did not pass -J. While I don't have a test case where that happens and causes out of order output, it looks like it could, and so prudent to make this change. --- CmdLine/Action.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs index 591c590b9a..03a664fd6c 100644 --- a/CmdLine/Action.hs +++ b/CmdLine/Action.hs @@ -55,7 +55,9 @@ commandActions = mapM_ commandAction commandAction :: CommandStart -> Annex () commandAction start = getConcurrency >>= \case NonConcurrent -> runnonconcurrent - Concurrent _ -> runconcurrent + Concurrent n + | n > 1 -> runconcurrent + | otherwise -> runnonconcurrent ConcurrentPerCpu -> runconcurrent where runnonconcurrent = void $ includeCommandAction start -- 2.30.2