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
bc0666fb
Commit
bc0666fb
authored
Feb 05, 2018
by
Martin Holst Swende
Committed by
Péter Szilágyi
Feb 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: fix #15858 by checking if downloader dropPeer function is set (#15992)
parent
0662384d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
downloader.go
eth/downloader/downloader.go
+20
-3
No files found.
eth/downloader/downloader.go
View file @
bc0666fb
...
...
@@ -324,8 +324,13 @@ func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode
errEmptyHeaderSet
,
errPeersUnavailable
,
errTooOld
,
errInvalidAncestor
,
errInvalidChain
:
log
.
Warn
(
"Synchronisation failed, dropping peer"
,
"peer"
,
id
,
"err"
,
err
)
if
d
.
dropPeer
==
nil
{
// The dropPeer method is nil when `--copydb` is used for a local copy.
// Timeouts can occur if e.g. compaction hits at the wrong time, and can be ignored
log
.
Warn
(
"Downloader wants to drop peer, but peerdrop-function is not set"
,
"peer"
,
id
)
}
else
{
d
.
dropPeer
(
id
)
}
default
:
log
.
Warn
(
"Synchronisation failed, retrying"
,
"err"
,
err
)
}
...
...
@@ -853,6 +858,12 @@ func (d *Downloader) fetchHeaders(p *peerConnection, from uint64) error {
getHeaders
(
from
)
case
<-
timeout
.
C
:
if
d
.
dropPeer
==
nil
{
// The dropPeer method is nil when `--copydb` is used for a local copy.
// Timeouts can occur if e.g. compaction hits at the wrong time, and can be ignored
p
.
log
.
Warn
(
"Downloader wants to drop peer, but peerdrop-function is not set"
,
"peer"
,
p
.
id
)
break
}
// Header retrieval timed out, consider the peer bad and drop
p
.
log
.
Debug
(
"Header request timed out"
,
"elapsed"
,
ttl
)
headerTimeoutMeter
.
Mark
(
1
)
...
...
@@ -1071,10 +1082,16 @@ func (d *Downloader) fetchParts(errCancel error, deliveryCh chan dataPack, deliv
setIdle
(
peer
,
0
)
}
else
{
peer
.
log
.
Debug
(
"Stalling delivery, dropping"
,
"type"
,
kind
)
if
d
.
dropPeer
==
nil
{
// The dropPeer method is nil when `--copydb` is used for a local copy.
// Timeouts can occur if e.g. compaction hits at the wrong time, and can be ignored
peer
.
log
.
Warn
(
"Downloader wants to drop peer, but peerdrop-function is not set"
,
"peer"
,
pid
)
}
else
{
d
.
dropPeer
(
pid
)
}
}
}
}
// If there's nothing more to fetch, wait or terminate
if
pending
()
==
0
{
if
!
inFlight
()
&&
finished
{
...
...
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