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) {
// StartProcesses starts the sending threads. Adheres to the xxdk.Service type.
func (m *manager) StartProcesses() (stoppable.Stoppable, error) {
// Construct stoppables
sendStoppable := stoppable.NewMulti(workerPoolStoppable)
multiStoppable := stoppable.NewMulti(fileTransferStoppable)
batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable)
// Start sending threads
......@@ -226,14 +226,12 @@ 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(sendStoppable)
m.startSendingWorkerPool(multiStoppable)
jww.INFO.Printf("STOPPING FT THREAD DEBUG: \nmultiStoppable running proc: %v\nmultistop: %v\n",
sendStoppable, sendStoppable.GetRunningProcesses())
multiStoppable, multiStoppable.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)
......
......@@ -128,9 +128,9 @@ func (m *Multi) Close() error {
// Attempt to stop each stoppable in its own goroutine
for _, stoppable := range m.stoppables {
wg.Add(1)
jww.INFO.Printf("FT DEBUG: stopping %s", stoppable.Name())
go func(stoppable Stoppable) {
if stoppable.Close() != nil {
go func(s Stoppable) {
jww.INFO.Printf("FT DEBUG: stopping %s", s.Name())
if s.Close() != nil {
atomic.AddUint32(&numErrors, 1)
}
wg.Done()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment