Skip to content
Snippets Groups Projects
Commit f19bd05b authored by Jono Wenger's avatar Jono Wenger
Browse files

Remove debugging logs

parent 8a3833c3
No related branches found
No related tags found
1 merge request!430XX-4277 / Fix file transfer crashes
This commit is part of merge request !430. Comments created here will be created in the context of that merge request.
...@@ -201,7 +201,6 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32, ...@@ -201,7 +201,6 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32,
base64.StdEncoding.EncodeToString(recipientID)) base64.StdEncoding.EncodeToString(recipientID))
// Unmarshal recipient ID // Unmarshal recipient ID
jww.INFO.Printf("** FileTransfer.Send before id.Unmarshal")
recipient, err := id.Unmarshal(recipientID) recipient, err := id.Unmarshal(recipientID)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -209,7 +208,6 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32, ...@@ -209,7 +208,6 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32,
p := time.Millisecond * time.Duration(period) p := time.Millisecond * time.Duration(period)
jww.INFO.Printf("** FileTransfer.Send before building CB")
// Wrap transfer progress callback to be passed to fileTransfer layer // Wrap transfer progress callback to be passed to fileTransfer layer
cb := func(completed bool, arrived, total uint16, cb := func(completed bool, arrived, total uint16,
st fileTransfer.SentTransfer, t fileTransfer.FilePartTracker, err error) { st fileTransfer.SentTransfer, t fileTransfer.FilePartTracker, err error) {
...@@ -228,14 +226,12 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32, ...@@ -228,14 +226,12 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32,
} }
// Unmarshal payload // Unmarshal payload
jww.INFO.Printf("** FileTransfer.Send before unmarshal FileSend")
var fs FileSend var fs FileSend
if err = json.Unmarshal(payload, &fs); err != nil { if err = json.Unmarshal(payload, &fs); err != nil {
return nil, err return nil, err
} }
// Send file // Send file
jww.INFO.Printf("** FileTransfer.Send before send")
ftID, err := f.w.Send( ftID, err := f.w.Send(
recipient, fs.Name, fs.Type, fs.Contents, retry, fs.Preview, cb, p) recipient, fs.Name, fs.Type, fs.Contents, retry, fs.Preview, cb, p)
if err != nil { if err != nil {
...@@ -243,7 +239,6 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32, ...@@ -243,7 +239,6 @@ func (f *FileTransfer) Send(payload, recipientID []byte, retry float32,
} }
// Return Transfer ID // Return Transfer ID
jww.INFO.Printf("** FileTransfer.Send before return")
return ftID.Bytes(), nil return ftID.Bytes(), nil
} }
......
...@@ -64,15 +64,11 @@ func (sw *Switchboard) RegisterListener(user *id.ID, ...@@ -64,15 +64,11 @@ func (sw *Switchboard) RegisterListener(user *id.ID,
} }
//register the listener by both ID and messageType //register the listener by both ID and messageType
jww.INFO.Printf("** Before Mux")
sw.mux.Lock() sw.mux.Lock()
jww.INFO.Printf("** Before ID Add")
sw.id.Add(lid) sw.id.Add(lid)
jww.INFO.Printf("** Before messageType Add")
sw.messageType.Add(lid) sw.messageType.Add(lid)
jww.INFO.Printf("** Before Mux unlock")
sw.mux.Unlock() sw.mux.Unlock()
//return a ListenerID so it can be unregistered in the future //return a ListenerID so it can be unregistered in the future
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
package e2e package e2e
import ( import (
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/catalog" "gitlab.com/elixxir/client/catalog"
"gitlab.com/elixxir/client/e2e" "gitlab.com/elixxir/client/e2e"
"gitlab.com/elixxir/client/e2e/receive" "gitlab.com/elixxir/client/e2e/receive"
...@@ -91,15 +90,12 @@ func (w *Wrapper) Send(recipient *id.ID, fileName, fileType string, ...@@ -91,15 +90,12 @@ func (w *Wrapper) Send(recipient *id.ID, fileName, fileType string,
progressCB ft.SentProgressCallback, period time.Duration) ( progressCB ft.SentProgressCallback, period time.Duration) (
*ftCrypto.TransferID, error) { *ftCrypto.TransferID, error) {
jww.INFO.Printf("** Wrapper.Send before SendNew creation")
sendNew := func(transferInfo []byte) error { sendNew := func(transferInfo []byte) error {
return sendNewFileTransferMessage(recipient, transferInfo, w.e2e) return sendNewFileTransferMessage(recipient, transferInfo, w.e2e)
} }
jww.INFO.Printf("** Wrapper.Send before addEndMessageToCallback")
modifiedProgressCB := w.addEndMessageToCallback(progressCB) modifiedProgressCB := w.addEndMessageToCallback(progressCB)
jww.INFO.Printf("** Wrapper.Send before send")
return w.ft.Send(recipient, fileName, fileType, fileData, retry, preview, return w.ft.Send(recipient, fileName, fileType, fileData, retry, preview,
modifiedProgressCB, period, sendNew) modifiedProgressCB, period, sendNew)
} }
...@@ -119,13 +115,10 @@ func (w *Wrapper) RegisterSentProgressCallback(tid *ftCrypto.TransferID, ...@@ -119,13 +115,10 @@ func (w *Wrapper) RegisterSentProgressCallback(tid *ftCrypto.TransferID,
// message is not sent. // message is not sent.
func (w *Wrapper) addEndMessageToCallback( func (w *Wrapper) addEndMessageToCallback(
progressCB ft.SentProgressCallback) ft.SentProgressCallback { progressCB ft.SentProgressCallback) ft.SentProgressCallback {
jww.INFO.Printf("** Wrapper.addEndMessageToCallback before !w.p.NotifyUponCompletion")
if !w.p.NotifyUponCompletion { if !w.p.NotifyUponCompletion {
jww.INFO.Printf("** Wrapper.addEndMessageToCallback after !w.p.NotifyUponCompletion")
return progressCB return progressCB
} }
jww.INFO.Printf("** Wrapper.addEndMessageToCallback before return")
return func(completed bool, arrived, total uint16, return func(completed bool, arrived, total uint16,
st ft.SentTransfer, t ft.FilePartTracker, err error) { st ft.SentTransfer, t ft.FilePartTracker, err error) {
......
...@@ -270,10 +270,6 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string, ...@@ -270,10 +270,6 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string,
progressCB SentProgressCallback, period time.Duration, sendNew SendNew) ( progressCB SentProgressCallback, period time.Duration, sendNew SendNew) (
*ftCrypto.TransferID, error) { *ftCrypto.TransferID, error) {
jww.INFO.Printf(
"** Sending file transfer %q to %s. fileType:%s retry:%f preview:%q",
fileName, recipient, fileType, retry, preview)
// Return an error if the file name is too long // Return an error if the file name is too long
if len(fileName) > FileNameMaxLen { if len(fileName) > FileNameMaxLen {
return nil, errors.Errorf(errFileNameSize, len(fileName), FileNameMaxLen) return nil, errors.Errorf(errFileNameSize, len(fileName), FileNameMaxLen)
...@@ -295,21 +291,17 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string, ...@@ -295,21 +291,17 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string,
} }
// Return an error if the network is not healthy // Return an error if the network is not healthy
jww.INFO.Printf("** manager.Send before IsHealthy")
if !m.cmix.IsHealthy() { if !m.cmix.IsHealthy() {
return nil, errors.Errorf(errSendNetworkHealth, fileName) return nil, errors.Errorf(errSendNetworkHealth, fileName)
} }
// Generate new transfer key and transfer ID // Generate new transfer key and transfer ID
jww.INFO.Printf("** manager.Send before GetStream")
rng := m.rng.GetStream() rng := m.rng.GetStream()
jww.INFO.Printf("** manager.Send before NewTransferKey")
key, err := ftCrypto.NewTransferKey(rng) key, err := ftCrypto.NewTransferKey(rng)
if err != nil { if err != nil {
rng.Close() rng.Close()
return nil, errors.Errorf(errNewKey, err) return nil, errors.Errorf(errNewKey, err)
} }
jww.INFO.Printf("** manager.Send before NewTransferID")
tid, err := ftCrypto.NewTransferID(rng) tid, err := ftCrypto.NewTransferID(rng)
if err != nil { if err != nil {
rng.Close() rng.Close()
...@@ -318,18 +310,15 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string, ...@@ -318,18 +310,15 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string,
rng.Close() rng.Close()
// Generate transfer MAC // Generate transfer MAC
jww.INFO.Printf("** manager.Send before CreateTransferMAC")
mac := ftCrypto.CreateTransferMAC(fileData, key) mac := ftCrypto.CreateTransferMAC(fileData, key)
// Get size of each part and partition file into equal length parts // Get size of each part and partition file into equal length parts
jww.INFO.Printf("** manager.Send before NewPartMessage")
partMessage := fileMessage.NewPartMessage(m.cmix.GetMaxMessageLength()) partMessage := fileMessage.NewPartMessage(m.cmix.GetMaxMessageLength())
parts := partitionFile(fileData, partMessage.GetPartSize()) parts := partitionFile(fileData, partMessage.GetPartSize())
numParts := uint16(len(parts)) numParts := uint16(len(parts))
fileSize := uint32(len(fileData)) fileSize := uint32(len(fileData))
// Send the initial file transfer message over E2E // Send the initial file transfer message over E2E
jww.INFO.Printf("** manager.Send before TransferInfo")
info := &TransferInfo{ info := &TransferInfo{
fileName, fileType, key, mac, numParts, fileSize, retry, preview} fileName, fileType, key, mac, numParts, fileSize, retry, preview}
transferInfo, err := info.Marshal() transferInfo, err := info.Marshal()
...@@ -345,7 +334,6 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string, ...@@ -345,7 +334,6 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string,
} }
// Calculate the number of fingerprints to generate // Calculate the number of fingerprints to generate
jww.INFO.Printf("** manager.Send before calcNumberOfFingerprints")
numFps := calcNumberOfFingerprints(len(parts), retry) numFps := calcNumberOfFingerprints(len(parts), retry)
// Create new sent transfer // Create new sent transfer
...@@ -367,11 +355,9 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string, ...@@ -367,11 +355,9 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string,
for _, p := range st.GetUnsentParts() { for _, p := range st.GetUnsentParts() {
m.batchQueue <- p m.batchQueue <- p
} }
jww.INFO.Printf("** manager.Send before registerSentProgressCallback")
// Register the progress callback // Register the progress callback
m.registerSentProgressCallback(st, progressCB, period) m.registerSentProgressCallback(st, progressCB, period)
jww.INFO.Printf("** manager.Send before return")
return &tid, nil return &tid, nil
} }
......
...@@ -414,7 +414,6 @@ func (c *Cmix) GetRoundEvents() interfaces.RoundEvents { ...@@ -414,7 +414,6 @@ func (c *Cmix) GetRoundEvents() interfaces.RoundEvents {
// AddService adds a service to be controlled by the client thread control. // AddService adds a service to be controlled by the client thread control.
// These will be started and stopped with the network follower. // These will be started and stopped with the network follower.
func (c *Cmix) AddService(sp Service) error { func (c *Cmix) AddService(sp Service) error {
jww.INFO.Printf("** Before followerServices.add")
return c.followerServices.add(sp) return c.followerServices.add(sp)
} }
......
...@@ -9,7 +9,6 @@ package xxdk ...@@ -9,7 +9,6 @@ package xxdk
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/stoppable" "gitlab.com/elixxir/client/stoppable"
"sync" "sync"
"time" "time"
...@@ -39,23 +38,18 @@ func newServices() *services { ...@@ -39,23 +38,18 @@ func newServices() *services {
// add appends the service process to the list and adds it to the multi- // add appends the service process to the list and adds it to the multi-
// stoppable. Start running it if services are running. // stoppable. Start running it if services are running.
func (s *services) add(sp Service) error { func (s *services) add(sp Service) error {
jww.INFO.Printf("** Before services.mux.Lock")
s.mux.Lock() s.mux.Lock()
defer s.mux.Unlock() defer s.mux.Unlock()
// append the process to the list // append the process to the list
jww.INFO.Printf("** Before services append")
s.services = append(s.services, sp) s.services = append(s.services, sp)
// if services are running, start the process // if services are running, start the process
jww.INFO.Printf("** Before s.state == Running")
if s.state == Running { if s.state == Running {
jww.INFO.Printf("** Call service")
stop, err := sp() stop, err := sp()
if err != nil { if err != nil {
return errors.WithMessage(err, "Failed to start added service") return errors.WithMessage(err, "Failed to start added service")
} }
jww.INFO.Printf("** Call stoppable Add")
s.stoppable.Add(stop) s.stoppable.Add(stop)
} }
return nil return nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment