core: Additional logging for Context.Stop

Since stopping is a rather complex mechanism that relies on correct
handling of concurrency, it's handy to have these logs here to debug when
things don't happen in quite the right order.
This commit is contained in:
Martin Atkins 2018-09-25 15:11:15 -07:00
parent 847c8d6244
commit 21071fb679
1 changed files with 2 additions and 0 deletions

View File

@ -603,6 +603,7 @@ func (c *Context) Stop() {
// Grab the condition var before we exit
if cond := c.runCond; cond != nil {
log.Printf("[INFO] terraform: waiting for graceful stop to complete")
cond.Wait()
}
@ -779,6 +780,7 @@ func (c *Context) watchStop(walker *ContextGraphWalker) (chan struct{}, <-chan s
}
// If we're here, we're stopped, trigger the call.
log.Printf("[TRACE] Context: requesting providers and provisioners to gracefully stop")
{
// Copy the providers so that a misbehaved blocking Stop doesn't