Skip to content
Snippets Groups Projects
Commit d853a44a authored by Josh Brooks's avatar Josh Brooks
Browse files

Debug

parent 8ddb19ef
No related branches found
No related tags found
2 merge requests!510Release,!398Add debug log for file transfer not quitting
...@@ -215,7 +215,7 @@ func NewManager(params Params, user FtE2e) (FileTransfer, error) { ...@@ -215,7 +215,7 @@ func NewManager(params Params, user FtE2e) (FileTransfer, error) {
// StartProcesses starts the sending threads. Adheres to the xxdk.Service type. // StartProcesses starts the sending threads. Adheres to the xxdk.Service type.
func (m *manager) StartProcesses() (stoppable.Stoppable, error) { func (m *manager) StartProcesses() (stoppable.Stoppable, error) {
// Construct stoppables // Construct stoppables
sendStoppable := stoppable.NewMulti(workerPoolStoppable) multiStoppable := stoppable.NewMulti(fileTransferStoppable)
batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable) batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable)
// Start sending threads // Start sending threads
...@@ -226,14 +226,12 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) { ...@@ -226,14 +226,12 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) {
// running this asynchronously could result in a race condition where // running this asynchronously could result in a race condition where
// some worker threads are not added to senderPoolStop before that stoppable // some worker threads are not added to senderPoolStop before that stoppable
// is added to the multiStoppable. // is added to the multiStoppable.
m.startSendingWorkerPool(sendStoppable) m.startSendingWorkerPool(multiStoppable)
jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n", jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n",
sendStoppable, sendStoppable.GetRunningProcesses()) multiStoppable, multiStoppable.GetRunningProcesses())
// Create a multi stoppable // Create a multi stoppable
multiStoppable := stoppable.NewMulti(fileTransferStoppable)
multiStoppable.Add(batchBuilderStop) multiStoppable.Add(batchBuilderStop)
multiStoppable.Add(sendStoppable)
jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n", jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n",
multiStoppable.GetRunningProcesses(), multiStoppable) multiStoppable.GetRunningProcesses(), multiStoppable)
......
...@@ -128,9 +128,9 @@ func (m *Multi) Close() error { ...@@ -128,9 +128,9 @@ func (m *Multi) Close() error {
// Attempt to stop each stoppable in its own goroutine // Attempt to stop each stoppable in its own goroutine
for _, stoppable := range m.stoppables { for _, stoppable := range m.stoppables {
wg.Add(1) wg.Add(1)
jww.INFO.Printf("FT DEBUG: stopping %s", stoppable.Name()) go func(s Stoppable) {
go func(stoppable Stoppable) { jww.INFO.Printf("FT DEBUG: stopping %s", s.Name())
if stoppable.Close() != nil { if s.Close() != nil {
atomic.AddUint32(&numErrors, 1) atomic.AddUint32(&numErrors, 1)
} }
wg.Done() wg.Done()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment