@@ -30,6 +30,7 @@ import (
3030 "github.com/containerd/errdefs"
3131 containerType "github.com/moby/moby/api/types/container"
3232 "github.com/moby/moby/client"
33+ "github.com/sirupsen/logrus"
3334 "go.opentelemetry.io/otel"
3435 "go.opentelemetry.io/otel/attribute"
3536 "go.opentelemetry.io/otel/codes"
@@ -163,6 +164,7 @@ func (s *composeService) ExecutePlan(ctx context.Context, project *types.Project
163164 if _ , err := topologicalSort (plan ); err != nil {
164165 return err
165166 }
167+ logrus .Debugf ("plan: executing %d operations" , len (plan .Operations ))
166168
167169 // Pre-populate execution state with existing containers so that
168170 // resolveServiceReferences can find containers for services not
@@ -199,9 +201,11 @@ func (s *composeService) ExecutePlan(ctx context.Context, project *types.Project
199201 for {
200202 select {
201203 case <- ctx .Done ():
204+ logrus .Debugf ("plan: consumer exiting on context cancellation, %d operations remaining" , expect )
202205 return nil
203206 case doneOp := <- opCh :
204207 expect --
208+ logrus .Debugf ("plan: operation %s completed, %d remaining" , doneOp .ID , expect )
205209 if expect == 0 {
206210 return nil
207211 }
@@ -211,6 +215,7 @@ func (s *composeService) ExecutePlan(ctx context.Context, project *types.Project
211215 depCount [depID ]--
212216 if depCount [depID ] == 0 {
213217 depOp := plan .Operations [depID ]
218+ logrus .Debugf ("plan: scheduling %s (%s) — all dependencies satisfied" , depOp .ID , depOp .Type )
214219 eg .Go (func () error {
215220 if err := s .executeOperation (ctx , project , depOp , state ); err != nil {
216221 return err
@@ -226,6 +231,7 @@ func (s *composeService) ExecutePlan(ctx context.Context, project *types.Project
226231
227232 // Launch root operations
228233 for _ , op := range plan .Roots () {
234+ logrus .Debugf ("plan: launching root operation %s (%s)" , op .ID , op .Type )
229235 eg .Go (func () error {
230236 if err := s .executeOperation (ctx , project , op , state ); err != nil {
231237 return err
@@ -254,6 +260,7 @@ func (s *composeService) executeOperation(ctx context.Context, project *types.Pr
254260
255261 err := s .dispatchOperation (ctx , project , op , state )
256262 if err != nil {
263+ logrus .Debugf ("plan: operation %s failed: %v" , op .ID , err )
257264 span .SetStatus (codes .Error , err .Error ())
258265 span .RecordError (err )
259266 } else {
0 commit comments