Only check for ninja stuckness after it's been running for a bit
Bug: 62580037 Test: rm -rf out && m -j showcommands | grep "ninja may be stuck" || echo ok Change-Id: I8ff1bd216b5f8349ce9e06e5465a9f8d0663f8c0
This commit is contained in:
@@ -81,11 +81,19 @@ func runNinja(ctx Context, config Config) {
|
||||
}
|
||||
}
|
||||
// Poll the ninja log for updates; if it isn't updated enough, then we want to show some diagnostics
|
||||
done := make(chan struct{})
|
||||
defer close(done)
|
||||
ticker := time.NewTicker(ninjaHeartbeatDuration)
|
||||
defer ticker.Stop()
|
||||
checker := &statusChecker{}
|
||||
go func() {
|
||||
for !cmd.Done() {
|
||||
checker.check(ctx, config, logPath)
|
||||
time.Sleep(ninjaHeartbeatDuration)
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
checker.check(ctx, config, logPath)
|
||||
case <-done:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -127,5 +135,5 @@ func dumpStucknessDiagnostics(ctx Context, config Config, statusPath string, las
|
||||
output := cmd.CombinedOutputOrFatal()
|
||||
ctx.Verbose(string(output))
|
||||
|
||||
ctx.Printf("done\n")
|
||||
ctx.Verbosef("done\n")
|
||||
}
|
||||
|
Reference in New Issue
Block a user