diff --git a/fileTransfer/manager.go b/fileTransfer/manager.go index 5298b10a04531662b67f729f2f6e5d95344fd6db..fe62191fb69669af593222e8ecea32c74a3e86d0 100644 --- a/fileTransfer/manager.go +++ b/fileTransfer/manager.go @@ -215,7 +215,7 @@ func NewManager(params Params, user FtE2e) (FileTransfer, error) { // StartProcesses starts the sending threads. Adheres to the xxdk.Service type. func (m *manager) StartProcesses() (stoppable.Stoppable, error) { // Construct stoppables - senderPoolStop := stoppable.NewMulti(workerPoolStoppable) + multiStoppable := stoppable.NewMulti(fileTransferStoppable) batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable) // Start sending threads @@ -224,16 +224,15 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) { // running this asynchronously could result in a race condition where // some worker threads are not added to senderPoolStop before that stoppable // is added to the multiStoppable. - m.startSendingWorkerPool(senderPoolStop) + m.startSendingWorkerPool(multiStoppable) go m.batchBuilderThread(batchBuilderStop) // Create a multi stoppable - multiStoppable := stoppable.NewMulti(fileTransferStoppable) - jww.INFO.Printf("Adding senderStop with processes %v", - senderPoolStop.GetRunningProcesses()) - multiStoppable.Add(senderPoolStop) multiStoppable.Add(batchBuilderStop) + jww.INFO.Printf("STOPPING FT THREAD DEBUG: multiStoppable: %v", + multiStoppable.GetRunningProcesses()) + return multiStoppable, nil } diff --git a/stoppable/multi.go b/stoppable/multi.go index 3ac77c7507fb058af1deac2b098121b16d3569b0..92439f7083cb65f60517879449535485b53b575b 100644 --- a/stoppable/multi.go +++ b/stoppable/multi.go @@ -66,7 +66,7 @@ func (m *Multi) GetStatus() Status { status := s.GetStatus() if status < lowestStatus { lowestStatus = status - jww.TRACE.Printf("Stoppable %s has status %s", + jww.INFO.Printf("Stoppable %s has status %s", s.Name(), status.String()) } } diff --git a/stoppable/single.go b/stoppable/single.go index ea11ab42b586c3c1543509b5f575cda75f0cfca5..35013bb0b0713be98e94729c297a1b34c9d54288 100644 --- a/stoppable/single.go +++ b/stoppable/single.go @@ -68,7 +68,7 @@ func (s *Single) toStopping() error { return errors.Errorf(toStoppingErr, s.Name(), s.GetStatus(), Running) } - jww.TRACE.Printf("Switched status of single stoppable %q from %s to %s.", + jww.INFO.Printf("Switched status of single stoppable %q from %s to %s.", s.Name(), Running, Stopping) return nil @@ -83,7 +83,7 @@ func (s *Single) ToStopped() { s.Name(), s.GetStatus(), Stopping) } - jww.TRACE.Printf("Switched status of single stoppable %q from %s to %s.", + jww.INFO.Printf("Switched status of single stoppable %q from %s to %s.", s.Name(), Stopping, Stopped) } diff --git a/xxdk/services.go b/xxdk/services.go index 840215dc1d3998ebc301766b6232ebef10384d39..3642fdd8e25d2f6d44cadf3a17aeee994aea03d4 100644 --- a/xxdk/services.go +++ b/xxdk/services.go @@ -9,6 +9,7 @@ package xxdk import ( "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/stoppable" "sync" "time" @@ -51,6 +52,8 @@ func (s *services) add(sp Service) error { return errors.WithMessage(err, "Failed to start added service") } s.stoppable.Add(stop) + jww.INFO.Printf("STOPPING FT THREAD DEBUG: adding service %v", stop.Name()) + } return nil }