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.
This commit is contained in:
		
					parent
					
						
							
								877ef84a1b
							
						
					
				
			
			
				commit
				
					
						b6642dde8a
					
				
			
		
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -55,7 +55,9 @@ commandActions = mapM_ commandAction
 | 
				
			||||||
commandAction :: CommandStart -> Annex ()
 | 
					commandAction :: CommandStart -> Annex ()
 | 
				
			||||||
commandAction start = getConcurrency >>= \case
 | 
					commandAction start = getConcurrency >>= \case
 | 
				
			||||||
	NonConcurrent -> runnonconcurrent
 | 
						NonConcurrent -> runnonconcurrent
 | 
				
			||||||
	Concurrent _ -> runconcurrent
 | 
						Concurrent n
 | 
				
			||||||
 | 
							| n > 1 -> runconcurrent
 | 
				
			||||||
 | 
							| otherwise -> runnonconcurrent
 | 
				
			||||||
	ConcurrentPerCpu -> runconcurrent
 | 
						ConcurrentPerCpu -> runconcurrent
 | 
				
			||||||
  where
 | 
					  where
 | 
				
			||||||
	runnonconcurrent = void $ includeCommandAction start
 | 
						runnonconcurrent = void $ includeCommandAction start
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue