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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
9169356e
Commit
9169356e
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Add debugs and flaten out the stoppables for file transfer
parent
e3f30ba0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!510
Release
,
!381
Initial CTIDH
,
!378
Add a debug GetRunningProcesses to bindings
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fileTransfer/manager.go
+2
-4
2 additions, 4 deletions
fileTransfer/manager.go
fileTransfer/send.go
+5
-3
5 additions, 3 deletions
fileTransfer/send.go
stoppable/single.go
+1
-1
1 addition, 1 deletion
stoppable/single.go
with
8 additions
and
8 deletions
fileTransfer/manager.go
+
2
−
4
View file @
9169356e
...
@@ -215,16 +215,14 @@ func NewManager(params Params, user FtE2e) (FileTransfer, error) {
...
@@ -215,16 +215,14 @@ 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
multiStop
:=
stoppable
.
NewMulti
(
workerPool
Stoppable
)
multiStop
pable
:=
stoppable
.
NewMulti
(
fileTransfer
Stoppable
)
batchBuilderStop
:=
stoppable
.
NewSingle
(
batchBuilderThreadStoppable
)
batchBuilderStop
:=
stoppable
.
NewSingle
(
batchBuilderThreadStoppable
)
// Start sending threads
// Start sending threads
go
m
.
startSendingWorkerPool
(
multiStop
)
go
m
.
startSendingWorkerPool
(
multiStop
pable
)
go
m
.
batchBuilderThread
(
batchBuilderStop
)
go
m
.
batchBuilderThread
(
batchBuilderStop
)
// Create a multi stoppable
// Create a multi stoppable
multiStoppable
:=
stoppable
.
NewMulti
(
fileTransferStoppable
)
multiStoppable
.
Add
(
multiStop
)
multiStoppable
.
Add
(
batchBuilderStop
)
multiStoppable
.
Add
(
batchBuilderStop
)
return
multiStoppable
,
nil
return
multiStoppable
,
nil
...
...
This diff is collapsed.
Click to expand it.
fileTransfer/send.go
+
5
−
3
View file @
9169356e
...
@@ -63,7 +63,9 @@ func (m *manager) startSendingWorkerPool(multiStop *stoppable.Multi) {
...
@@ -63,7 +63,9 @@ func (m *manager) startSendingWorkerPool(multiStop *stoppable.Multi) {
for
i
:=
0
;
i
<
workerPoolThreads
;
i
++
{
for
i
:=
0
;
i
<
workerPoolThreads
;
i
++
{
stop
:=
stoppable
.
NewSingle
(
sendThreadStoppableName
+
strconv
.
Itoa
(
i
))
stop
:=
stoppable
.
NewSingle
(
sendThreadStoppableName
+
strconv
.
Itoa
(
i
))
multiStop
.
Add
(
stop
)
multiStop
.
Add
(
stop
)
go
m
.
sendingThread
(
stop
)
go
func
(
single
*
stoppable
.
Single
)
{
m
.
sendingThread
(
stop
)
}(
stop
)
}
}
}
}
...
@@ -74,8 +76,8 @@ func (m *manager) sendingThread(stop *stoppable.Single) {
...
@@ -74,8 +76,8 @@ func (m *manager) sendingThread(stop *stoppable.Single) {
for
{
for
{
select
{
select
{
case
<-
stop
.
Quit
()
:
case
<-
stop
.
Quit
()
:
jww
.
DEBUG
.
Printf
(
"[FT] Stopping file part sending thread: "
+
jww
.
DEBUG
.
Printf
(
"[FT] Stopping file part sending thread
(%s)
: "
+
"stoppable triggered."
)
"stoppable triggered."
,
stop
.
Name
()
)
m
.
cmix
.
RemoveHealthCallback
(
healthChanID
)
m
.
cmix
.
RemoveHealthCallback
(
healthChanID
)
stop
.
ToStopped
()
stop
.
ToStopped
()
return
return
...
...
This diff is collapsed.
Click to expand it.
stoppable/single.go
+
1
−
1
View file @
9169356e
...
@@ -83,7 +83,7 @@ func (s *Single) ToStopped() {
...
@@ -83,7 +83,7 @@ func (s *Single) ToStopped() {
s
.
Name
(),
s
.
GetStatus
(),
Stopping
)
s
.
Name
(),
s
.
GetStatus
(),
Stopping
)
}
}
jww
.
TRACE
.
Printf
(
"Switched status of single stoppable %q from %s to %s."
,
jww
.
DEBUG
.
Printf
(
"Switched status of single stoppable %q from %s to %s."
,
s
.
Name
(),
Stopping
,
Stopped
)
s
.
Name
(),
Stopping
,
Stopped
)
}
}
...
...
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