Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
78f45c78
Commit
78f45c78
authored
Apr 27, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
dc6474fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
go/neo/connection.go
go/neo/connection.go
+13
-9
No files found.
go/neo/connection.go
View file @
78f45c78
...
...
@@ -26,6 +26,7 @@ import (
"sync"
"fmt"
"lab.nexedi.com/kirr/go123/xruntime/debug"
)
// NodeLink is a node-node link in NEO
...
...
@@ -49,7 +50,8 @@ import (
type
NodeLink
struct
{
peerLink
net
.
Conn
// raw conn to peer
connMu
sync
.
Mutex
// TODO -> RW ?
//connMu sync.Mutex // TODO -> RW ?
connMu
debug
.
Mutex
// TODO -> RW ?
connTab
map
[
uint32
]
*
Conn
// connId -> Conn associated with connId
nextConnId
uint32
// next connId to use for Conn initiated by us
...
...
@@ -305,20 +307,21 @@ func (nl *NodeLink) serveRecv() {
if
err
!=
nil
{
// on IO error framing over peerLink becomes broken
// so we are marking node link and all connections as closed
println
(
"
\t
zzz"
)
nl
.
connMu
.
Lock
()
println
(
"
\t
zzz 2"
)
defer
nl
.
connMu
.
Unlock
()
println
(
"
\t
qqq"
)
select
{
case
<-
nl
.
closed
:
// error due to closing NodeLink
nl
.
recvE
rr
=
ErrLinkClosed
e
rr
=
ErrLinkClosed
default
:
nl
.
recvErr
=
err
}
println
(
"
\t
zzz"
)
nl
.
connMu
.
Lock
()
println
(
"
\t
zzz 2"
)
defer
nl
.
connMu
.
Unlock
()
nl
.
recvErr
=
err
println
(
"
\t
rrr"
)
// wake-up all conns & mark node link as closed
nl
.
close
()
...
...
@@ -403,9 +406,10 @@ func (nl *NodeLink) serveSend() {
// wake-up all conns & mark node link as closed
nl
.
close
()
}
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