diff --git a/fileTransfer/send.go b/fileTransfer/send.go index 9a4aa9ff1939584e5c3019455fab08376dc25e6e..a54f324c1815ac26a5920d68ab11d3ed6845068e 100644 --- a/fileTransfer/send.go +++ b/fileTransfer/send.go @@ -62,7 +62,9 @@ func (m *manager) startSendingWorkerPool(multiStop *stoppable.Multi) { for i := 0; i < workerPoolThreads; i++ { stop := stoppable.NewSingle(sendThreadStoppableName + strconv.Itoa(i)) - go m.sendingThread(stop) + go func(single *stoppable.Single) { + m.sendingThread(single) + }(stop) jww.INFO.Printf("Adding stoppable %s", stop.Name()) multiStop.Add(stop) } @@ -83,9 +85,12 @@ func (m *manager) sendingThread(stop *stoppable.Single) { return case healthy := <-healthChan: for !healthy { + jww.INFO.Printf("not healthy, waiting for health update") healthy = <-healthChan + jww.INFO.Printf("received health update, it is now set to %s", healthy) } case packet := <-m.sendQueue: + jww.INFO.Printf("sending packet") m.sendCmix(packet) } } diff --git a/stoppable/single.go b/stoppable/single.go index 02359ac451a3d8635589fb43f5fc179d4aea2349..b2313a3fc1f813aae9284b3a385011db1408d9cb 100644 --- a/stoppable/single.go +++ b/stoppable/single.go @@ -90,6 +90,7 @@ func (s *Single) ToStopped() { // Quit returns a receive-only channel that will be triggered when the Stoppable // quits. func (s *Single) Quit() <-chan struct{} { + jww.INFO.Printf("Quit for %s", s.name) return s.quit } @@ -110,6 +111,10 @@ func (s *Single) Close() error { // Send on quit channel s.quit <- struct{}{} + + jww.INFO.Printf("Sent to quit channel for single stoppable %q.", + s.Name()) + }) if err != nil {