good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
open
bor
Commits
099be041
Unverified
Commit
099be041
authored
4 years ago
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
eth/protocols/snap: add peer id and req id to the timeout logs
parent
063f78c6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eth/protocols/snap/sync.go
+25
-15
25 additions, 15 deletions
eth/protocols/snap/sync.go
with
25 additions
and
15 deletions
eth/protocols/snap/sync.go
+
25
−
15
View file @
099be041
...
...
@@ -811,6 +811,8 @@ func (s *Syncer) assignAccountTasks(cancel chan struct{}) {
if
idle
==
""
{
return
}
peer
:=
s
.
peers
[
idle
]
// Matched a pending task to an idle peer, allocate a unique request id
var
reqid
uint64
for
{
...
...
@@ -834,14 +836,14 @@ func (s *Syncer) assignAccountTasks(cancel chan struct{}) {
task
:
task
,
}
req
.
timeout
=
time
.
AfterFunc
(
requestTimeout
,
func
()
{
log
.
Debug
(
"Account range request timed out"
)
peer
.
Log
()
.
Debug
(
"Account range request timed out"
,
"reqid"
,
reqid
)
s
.
scheduleRevertAccountRequest
(
req
)
})
s
.
accountReqs
[
reqid
]
=
req
delete
(
s
.
accountIdlers
,
idle
)
s
.
pend
.
Add
(
1
)
go
func
(
peer
SyncPeer
,
root
common
.
Hash
)
{
go
func
(
root
common
.
Hash
)
{
defer
s
.
pend
.
Done
()
// Attempt to send the remote request and revert if it fails
...
...
@@ -849,7 +851,7 @@ func (s *Syncer) assignAccountTasks(cancel chan struct{}) {
peer
.
Log
()
.
Debug
(
"Failed to request account range"
,
"err"
,
err
)
s
.
scheduleRevertAccountRequest
(
req
)
}
}(
s
.
peers
[
idle
],
s
.
root
)
// We're in the lock, peers[id] surely exists
}(
s
.
root
)
// Inject the request into the task to block further assignments
task
.
req
=
req
...
...
@@ -891,6 +893,8 @@ func (s *Syncer) assignBytecodeTasks(cancel chan struct{}) {
if
idle
==
""
{
return
}
peer
:=
s
.
peers
[
idle
]
// Matched a pending task to an idle peer, allocate a unique request id
var
reqid
uint64
for
{
...
...
@@ -921,14 +925,14 @@ func (s *Syncer) assignBytecodeTasks(cancel chan struct{}) {
task
:
task
,
}
req
.
timeout
=
time
.
AfterFunc
(
requestTimeout
,
func
()
{
log
.
Debug
(
"Bytecode request timed out"
)
peer
.
Log
()
.
Debug
(
"Bytecode request timed out"
,
"reqid"
,
reqid
)
s
.
scheduleRevertBytecodeRequest
(
req
)
})
s
.
bytecodeReqs
[
reqid
]
=
req
delete
(
s
.
bytecodeIdlers
,
idle
)
s
.
pend
.
Add
(
1
)
go
func
(
peer
SyncPeer
)
{
go
func
()
{
defer
s
.
pend
.
Done
()
// Attempt to send the remote request and revert if it fails
...
...
@@ -936,7 +940,7 @@ func (s *Syncer) assignBytecodeTasks(cancel chan struct{}) {
log
.
Debug
(
"Failed to request bytecodes"
,
"err"
,
err
)
s
.
scheduleRevertBytecodeRequest
(
req
)
}
}(
s
.
peers
[
idle
])
// We're in the lock, peers[id] surely exists
}(
)
}
}
...
...
@@ -976,6 +980,8 @@ func (s *Syncer) assignStorageTasks(cancel chan struct{}) {
if
idle
==
""
{
return
}
peer
:=
s
.
peers
[
idle
]
// Matched a pending task to an idle peer, allocate a unique request id
var
reqid
uint64
for
{
...
...
@@ -1045,14 +1051,14 @@ func (s *Syncer) assignStorageTasks(cancel chan struct{}) {
req
.
limit
=
subtask
.
Last
}
req
.
timeout
=
time
.
AfterFunc
(
requestTimeout
,
func
()
{
log
.
Debug
(
"Storage request timed out"
)
peer
.
Log
()
.
Debug
(
"Storage request timed out"
,
"reqid"
,
reqid
)
s
.
scheduleRevertStorageRequest
(
req
)
})
s
.
storageReqs
[
reqid
]
=
req
delete
(
s
.
storageIdlers
,
idle
)
s
.
pend
.
Add
(
1
)
go
func
(
peer
SyncPeer
,
root
common
.
Hash
)
{
go
func
(
root
common
.
Hash
)
{
defer
s
.
pend
.
Done
()
// Attempt to send the remote request and revert if it fails
...
...
@@ -1064,7 +1070,7 @@ func (s *Syncer) assignStorageTasks(cancel chan struct{}) {
log
.
Debug
(
"Failed to request storage"
,
"err"
,
err
)
s
.
scheduleRevertStorageRequest
(
req
)
}
}(
s
.
peers
[
idle
],
s
.
root
)
// We're in the lock, peers[id] surely exists
}(
s
.
root
)
// Inject the request into the subtask to block further assignments
if
subtask
!=
nil
{
...
...
@@ -1121,6 +1127,8 @@ func (s *Syncer) assignTrienodeHealTasks(cancel chan struct{}) {
if
idle
==
""
{
return
}
peer
:=
s
.
peers
[
idle
]
// Matched a pending task to an idle peer, allocate a unique request id
var
reqid
uint64
for
{
...
...
@@ -1160,14 +1168,14 @@ func (s *Syncer) assignTrienodeHealTasks(cancel chan struct{}) {
task
:
s
.
healer
,
}
req
.
timeout
=
time
.
AfterFunc
(
requestTimeout
,
func
()
{
log
.
Debug
(
"Trienode heal request timed out"
)
peer
.
Log
()
.
Debug
(
"Trienode heal request timed out"
,
"reqid"
,
reqid
)
s
.
scheduleRevertTrienodeHealRequest
(
req
)
})
s
.
trienodeHealReqs
[
reqid
]
=
req
delete
(
s
.
trienodeHealIdlers
,
idle
)
s
.
pend
.
Add
(
1
)
go
func
(
peer
SyncPeer
,
root
common
.
Hash
)
{
go
func
(
root
common
.
Hash
)
{
defer
s
.
pend
.
Done
()
// Attempt to send the remote request and revert if it fails
...
...
@@ -1175,7 +1183,7 @@ func (s *Syncer) assignTrienodeHealTasks(cancel chan struct{}) {
log
.
Debug
(
"Failed to request trienode healers"
,
"err"
,
err
)
s
.
scheduleRevertTrienodeHealRequest
(
req
)
}
}(
s
.
peers
[
idle
],
s
.
root
)
// We're in the lock, peers[id] surely exists
}(
s
.
root
)
}
}
...
...
@@ -1227,6 +1235,8 @@ func (s *Syncer) assignBytecodeHealTasks(cancel chan struct{}) {
if
idle
==
""
{
return
}
peer
:=
s
.
peers
[
idle
]
// Matched a pending task to an idle peer, allocate a unique request id
var
reqid
uint64
for
{
...
...
@@ -1258,14 +1268,14 @@ func (s *Syncer) assignBytecodeHealTasks(cancel chan struct{}) {
task
:
s
.
healer
,
}
req
.
timeout
=
time
.
AfterFunc
(
requestTimeout
,
func
()
{
log
.
Debug
(
"Bytecode heal request timed out"
)
peer
.
Log
()
.
Debug
(
"Bytecode heal request timed out"
,
"reqid"
,
reqid
)
s
.
scheduleRevertBytecodeHealRequest
(
req
)
})
s
.
bytecodeHealReqs
[
reqid
]
=
req
delete
(
s
.
bytecodeHealIdlers
,
idle
)
s
.
pend
.
Add
(
1
)
go
func
(
peer
SyncPeer
)
{
go
func
()
{
defer
s
.
pend
.
Done
()
// Attempt to send the remote request and revert if it fails
...
...
@@ -1273,7 +1283,7 @@ func (s *Syncer) assignBytecodeHealTasks(cancel chan struct{}) {
log
.
Debug
(
"Failed to request bytecode healers"
,
"err"
,
err
)
s
.
scheduleRevertBytecodeHealRequest
(
req
)
}
}(
s
.
peers
[
idle
])
// We're in the lock, peers[id] surely exists
}(
)
}
}
...
...
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