From 21071fb6794dfa1a8bed596ca8aeb73328b81a5e Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 25 Sep 2018 15:11:15 -0700 Subject: [PATCH] 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. --- terraform/context.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/context.go b/terraform/context.go index 8f2be6311..0c99f893f 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -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