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

Add debug logs

parent b6891d89
No related branches found
No related tags found
1 merge request!430XX-4277 / Fix file transfer crashes
......@@ -29,6 +29,7 @@ const (
// batchBuilderThread creates batches of file parts as they become available and
// buffer them to send. Also rate limits adding to the buffer.
func (m *manager) batchBuilderThread(stop *stoppable.Single) {
jww.INFO.Printf("[FT] Starting batch builder thread.")
// Calculate rate and make rate limiter
rl := newRateLimiter(m.params.MaxThroughput, m.cmixGroup)
......
......@@ -319,6 +319,8 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string,
if err != nil {
return nil, errors.Errorf(errMarshalInfo, err)
}
jww.DEBUG.Printf("[FT] Sending init message for file transfer %q: %+v", info)
err = sendNew(transferInfo)
if err != nil {
return nil, errors.Errorf(errSendNewMsg, err)
......@@ -328,12 +330,21 @@ func (m *manager) Send(recipient *id.ID, fileName, fileType string,
numFps := calcNumberOfFingerprints(len(parts), retry)
// Create new sent transfer
jww.DEBUG.Printf("[FT] Adding sent file transfer %q "+
"(type %s, size %d bytes, %d parts, retry %f)",
fileName, fileType, fileSize, numParts, retry)
st, err := m.sent.AddTransfer(
recipient, &key, &tid, fileName, fileSize, parts, numFps)
if err != nil {
return nil, errors.Errorf(errAddSentTransfer, err)
}
jww.DEBUG.Printf("[FT] Created new sent file transfer %s for %q "+
"(type %s, size %d bytes, %d parts, retry %f)",
st.TransferID(), fileName, fileType, fileSize, numParts, retry)
// Add all parts to the send queue
for _, p := range st.GetUnsentParts() {
m.batchQueue <- p
......
......@@ -50,6 +50,7 @@ const (
// startSendingWorkerPool initialises a worker pool of file part sending
// threads.
func (m *manager) startSendingWorkerPool(multiStop *stoppable.Multi) {
jww.INFO.Printf("[FT] Starting %d sending worker threads.", workerPoolThreads)
// Set up cMix sending parameters
m.params.Cmix.SendTimeout = m.params.SendTimeout
m.params.Cmix.ExcludedRounds =
......@@ -70,6 +71,7 @@ func (m *manager) startSendingWorkerPool(multiStop *stoppable.Multi) {
// sendingThread sends part packets that become available oin the send queue.
func (m *manager) sendingThread(stop *stoppable.Single) {
jww.INFO.Printf("[FT] Starting sending worker thread %s.", stop.Name())
healthChan := make(chan bool, 10)
healthChanID := m.cmix.AddHealthCallback(func(b bool) { healthChan <- b })
for {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment