Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
4c8901c5
Commit
4c8901c5
authored
Oct 26, 2022
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Add debug logs
parent
b6891d89
No related branches found
No related tags found
1 merge request
!430
XX-4277 / Fix file transfer crashes
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
fileTransfer/batchBuilder.go
+1
-0
1 addition, 0 deletions
fileTransfer/batchBuilder.go
fileTransfer/manager.go
+11
-0
11 additions, 0 deletions
fileTransfer/manager.go
fileTransfer/send.go
+2
-0
2 additions, 0 deletions
fileTransfer/send.go
with
14 additions
and
0 deletions
fileTransfer/batchBuilder.go
+
1
−
0
View file @
4c8901c5
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
fileTransfer/manager.go
+
11
−
0
View file @
4c8901c5
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
fileTransfer/send.go
+
2
−
0
View file @
4c8901c5
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment