From 0cc66ec05ac7662c16afbda0091dc617e0c8d835 Mon Sep 17 00:00:00 2001
From: joshemb <josh@elixxir.io>
Date: Tue, 27 Sep 2022 17:18:52 -0700
Subject: [PATCH] Try some more debugs

---
 fileTransfer/manager.go | 11 ++++++++---
 stoppable/single.go     |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/fileTransfer/manager.go b/fileTransfer/manager.go
index 55fbd90e0..ba5ca3e25 100644
--- a/fileTransfer/manager.go
+++ b/fileTransfer/manager.go
@@ -215,20 +215,25 @@ 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
-	multiStoppable := stoppable.NewMulti(fileTransferStoppable)
+	sendStoppable := stoppable.NewMulti(sendThreadStoppableName)
 	batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable)
 
 	// Start sending threads
+	go m.batchBuilderThread(batchBuilderStop)
+
 	// Note that the startSendingWorkerPool already creates thread for every
 	// worker. As a result, there is no need to run it asynchronously. In fact,
 	// 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(multiStoppable)
-	go m.batchBuilderThread(batchBuilderStop)
+	m.startSendingWorkerPool(sendStoppable)
+	jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n",
+		sendStoppable, sendStoppable.GetRunningProcesses())
 
 	// Create a multi stoppable
+	multiStoppable := stoppable.NewMulti(fileTransferStoppable)
 	multiStoppable.Add(batchBuilderStop)
+	multiStoppable.Add(sendStoppable)
 
 	jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n",
 		multiStoppable.GetRunningProcesses(), multiStoppable)
diff --git a/stoppable/single.go b/stoppable/single.go
index 35013bb0b..02359ac45 100644
--- a/stoppable/single.go
+++ b/stoppable/single.go
@@ -105,7 +105,7 @@ func (s *Single) Close() error {
 			return
 		}
 
-		jww.TRACE.Printf("Sending on quit channel to single stoppable %q.",
+		jww.INFO.Printf("Sending on quit channel to single stoppable %q.",
 			s.Name())
 
 		// Send on quit channel
-- 
GitLab