Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
vicotor
mybee
Commits
d85169e0
Unverified
Commit
d85169e0
authored
Nov 23, 2020
by
Nemanja Zbiljić
Committed by
GitHub
Nov 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pushsync should not blocklist peer (#1011)
parent
3ceb51de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
17 deletions
+1
-17
pushsync.go
pkg/pushsync/pushsync.go
+1
-17
No files found.
pkg/pushsync/pushsync.go
View file @
d85169e0
...
@@ -31,7 +31,6 @@ const (
...
@@ -31,7 +31,6 @@ const (
const
(
const
(
maxPeers
=
5
maxPeers
=
5
blocklistDuration
=
time
.
Minute
)
)
type
PushSyncer
interface
{
type
PushSyncer
interface
{
...
@@ -311,9 +310,6 @@ func (ps *PushSync) PushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Re
...
@@ -311,9 +310,6 @@ func (ps *PushSync) PushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Re
_
=
streamer
.
Reset
()
_
=
streamer
.
Reset
()
lastErr
=
fmt
.
Errorf
(
"chunk deliver to peer %s: %w"
,
peer
.
String
(),
err
)
lastErr
=
fmt
.
Errorf
(
"chunk deliver to peer %s: %w"
,
peer
.
String
(),
err
)
ps
.
logger
.
Debugf
(
"pushsync-push: %v"
,
lastErr
)
ps
.
logger
.
Debugf
(
"pushsync-push: %v"
,
lastErr
)
if
errors
.
Is
(
err
,
context
.
DeadlineExceeded
)
{
ps
.
blocklistPeer
(
peer
)
}
continue
continue
}
}
...
@@ -332,9 +328,6 @@ func (ps *PushSync) PushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Re
...
@@ -332,9 +328,6 @@ func (ps *PushSync) PushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Re
_
=
streamer
.
Reset
()
_
=
streamer
.
Reset
()
lastErr
=
fmt
.
Errorf
(
"receive receipt from peer %s: %w"
,
peer
.
String
(),
err
)
lastErr
=
fmt
.
Errorf
(
"receive receipt from peer %s: %w"
,
peer
.
String
(),
err
)
ps
.
logger
.
Debugf
(
"pushsync-push: %v"
,
lastErr
)
ps
.
logger
.
Debugf
(
"pushsync-push: %v"
,
lastErr
)
if
errors
.
Is
(
err
,
context
.
DeadlineExceeded
)
{
ps
.
blocklistPeer
(
peer
)
}
continue
continue
}
}
ps
.
metrics
.
ReceiptRTT
.
Observe
(
time
.
Since
(
receiptRTTTimer
)
.
Seconds
())
ps
.
metrics
.
ReceiptRTT
.
Observe
(
time
.
Since
(
receiptRTTTimer
)
.
Seconds
())
...
@@ -367,15 +360,6 @@ func (ps *PushSync) PushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Re
...
@@ -367,15 +360,6 @@ func (ps *PushSync) PushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Re
return
nil
,
topology
.
ErrNotFound
return
nil
,
topology
.
ErrNotFound
}
}
func
(
ps
*
PushSync
)
blocklistPeer
(
peer
swarm
.
Address
)
{
if
err
:=
ps
.
streamer
.
Blocklist
(
peer
,
blocklistDuration
);
err
!=
nil
{
ps
.
logger
.
Errorf
(
"pushsync-push: unable to block peer %s"
,
peer
)
ps
.
logger
.
Debugf
(
"pushsync-push: blocking peer %s: %v"
,
peer
,
err
)
}
else
{
ps
.
logger
.
Warningf
(
"pushsync-push: peer %s blocked as unresponsive"
,
peer
)
}
}
func
(
ps
*
PushSync
)
handleDeliveryResponse
(
ctx
context
.
Context
,
w
protobuf
.
Writer
,
p
p2p
.
Peer
,
chunk
swarm
.
Chunk
)
error
{
func
(
ps
*
PushSync
)
handleDeliveryResponse
(
ctx
context
.
Context
,
w
protobuf
.
Writer
,
p
p2p
.
Peer
,
chunk
swarm
.
Chunk
)
error
{
// Store the chunk in the local store
// Store the chunk in the local store
_
,
err
:=
ps
.
storer
.
Put
(
ctx
,
storage
.
ModePutSync
,
chunk
)
_
,
err
:=
ps
.
storer
.
Put
(
ctx
,
storage
.
ModePutSync
,
chunk
)
...
...
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