Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
goshimmer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
iota-imt
goshimmer
Commits
148a7d23
Unverified
Commit
148a7d23
authored
5 years ago
by
Luca Moser
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
increases send queue and ignore sending if connection is closed (#232)
parent
a707057a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/gossip/manager.go
+1
-1
1 addition, 1 deletion
packages/gossip/manager.go
packages/gossip/neighbor.go
+5
-2
5 additions, 2 deletions
packages/gossip/neighbor.go
with
6 additions
and
3 deletions
packages/gossip/manager.go
+
1
−
1
View file @
148a7d23
...
...
@@ -174,7 +174,7 @@ func (m *Manager) send(b []byte, to ...peer.ID) {
for
_
,
nbr
:=
range
neighbors
{
if
_
,
err
:=
nbr
.
Write
(
b
);
err
!=
nil
{
m
.
log
.
Warnw
(
"send error"
,
"err"
,
err
)
m
.
log
.
Warnw
(
"send error"
,
"err"
,
err
,
"neighbor"
,
nbr
.
Peer
.
Address
()
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
packages/gossip/neighbor.go
+
5
−
2
View file @
148a7d23
...
...
@@ -19,7 +19,7 @@ var (
)
const
(
neighborQueueSize
=
1
000
neighborQueueSize
=
5
000
maxNumReadErrors
=
10
)
...
...
@@ -99,8 +99,9 @@ func (n *Neighbor) writeLoop() {
continue
}
if
_
,
err
:=
n
.
BufferedConnection
.
Write
(
msg
);
err
!=
nil
{
// ignore write errors
n
.
log
.
Warn
(
"Write error"
,
"err"
,
err
)
_
=
n
.
BufferedConnection
.
Close
()
return
}
case
<-
n
.
closing
:
return
...
...
@@ -146,6 +147,8 @@ func (n *Neighbor) Write(b []byte) (int, error) {
select
{
case
n
.
queue
<-
b
:
return
l
,
nil
case
<-
n
.
closing
:
return
0
,
nil
default
:
return
0
,
ErrNeighborQueueFull
}
...
...
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