From 70262f82834272e59f0cccb6a164ec43f3eec1c4 Mon Sep 17 00:00:00 2001 From: joshemb <josh@elixxir.io> Date: Tue, 27 Sep 2022 12:51:59 -0700 Subject: [PATCH] Add debugs --- fileTransfer/manager.go | 11 +++++------ stoppable/multi.go | 2 +- stoppable/single.go | 4 ++-- xxdk/services.go | 3 +++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fileTransfer/manager.go b/fileTransfer/manager.go index 5298b10a0..fe62191fb 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 3ac77c750..92439f708 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 ea11ab42b..35013bb0b 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 840215dc1..3642fdd8e 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 } -- GitLab