Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
b0bbd471
Unverified
Commit
b0bbd471
authored
Apr 27, 2020
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: fix shutdown regression to abort downloads, not just cancel
parent
1aa83290
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
downloader.go
eth/downloader/downloader.go
+2
-1
sync.go
eth/sync.go
+1
-1
No files found.
eth/downloader/downloader.go
View file @
b0bbd471
...
@@ -557,6 +557,8 @@ func (d *Downloader) spawnSync(fetchers []func() error) error {
...
@@ -557,6 +557,8 @@ func (d *Downloader) spawnSync(fetchers []func() error) error {
func
(
d
*
Downloader
)
cancel
()
{
func
(
d
*
Downloader
)
cancel
()
{
// Close the current cancel channel
// Close the current cancel channel
d
.
cancelLock
.
Lock
()
d
.
cancelLock
.
Lock
()
defer
d
.
cancelLock
.
Unlock
()
if
d
.
cancelCh
!=
nil
{
if
d
.
cancelCh
!=
nil
{
select
{
select
{
case
<-
d
.
cancelCh
:
case
<-
d
.
cancelCh
:
...
@@ -565,7 +567,6 @@ func (d *Downloader) cancel() {
...
@@ -565,7 +567,6 @@ func (d *Downloader) cancel() {
close
(
d
.
cancelCh
)
close
(
d
.
cancelCh
)
}
}
}
}
d
.
cancelLock
.
Unlock
()
}
}
// Cancel aborts all of the operations and waits for all download goroutines to
// Cancel aborts all of the operations and waits for all download goroutines to
...
...
eth/sync.go
View file @
b0bbd471
...
@@ -222,7 +222,7 @@ func (cs *chainSyncer) loop() {
...
@@ -222,7 +222,7 @@ func (cs *chainSyncer) loop() {
case
<-
cs
.
pm
.
quitSync
:
case
<-
cs
.
pm
.
quitSync
:
if
cs
.
doneCh
!=
nil
{
if
cs
.
doneCh
!=
nil
{
cs
.
pm
.
downloader
.
Cancel
()
cs
.
pm
.
downloader
.
Terminate
()
// Double term is fine, Cancel would block until queue is emptied
<-
cs
.
doneCh
<-
cs
.
doneCh
}
}
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment