Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
cb23e144
Commit
cb23e144
authored
Apr 28, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6c7942f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
go/neo/connection.go
go/neo/connection.go
+3
-4
go/neo/connection_test.go
go/neo/connection_test.go
+1
-1
No files found.
go/neo/connection.go
View file @
cb23e144
...
@@ -27,7 +27,6 @@ import (
...
@@ -27,7 +27,6 @@ import (
"sync/atomic"
"sync/atomic"
"fmt"
"fmt"
//"lab.nexedi.com/kirr/go123/xruntime/debug"
)
)
// NodeLink is a node-node link in NEO
// NodeLink is a node-node link in NEO
...
@@ -237,7 +236,7 @@ func (c *Conn) shutdown() {
...
@@ -237,7 +236,7 @@ func (c *Conn) shutdown() {
// background on the wire not to break node-node link framing.
// background on the wire not to break node-node link framing.
func
(
c
*
Conn
)
Close
()
error
{
func
(
c
*
Conn
)
Close
()
error
{
// adjust nodeLink.connTab
// adjust nodeLink.connTab
// (if nodelink was already shut
ted
down and connTab=nil - delete will be noop)
// (if nodelink was already shut down and connTab=nil - delete will be noop)
c
.
nodeLink
.
connMu
.
Lock
()
c
.
nodeLink
.
connMu
.
Lock
()
delete
(
c
.
nodeLink
.
connTab
,
c
.
connId
)
delete
(
c
.
nodeLink
.
connTab
,
c
.
connId
)
c
.
nodeLink
.
connMu
.
Unlock
()
c
.
nodeLink
.
connMu
.
Unlock
()
...
@@ -329,7 +328,7 @@ func (nl *NodeLink) serveRecv() {
...
@@ -329,7 +328,7 @@ func (nl *NodeLink) serveRecv() {
nl
.
connMu
.
Lock
()
nl
.
connMu
.
Lock
()
// connTab is never nil here - bec
ua
se shutdown before
// connTab is never nil here - bec
au
se shutdown before
// resetting it waits for us to finish.
// resetting it waits for us to finish.
conn
:=
nl
.
connTab
[
connId
]
conn
:=
nl
.
connTab
[
connId
]
if
conn
==
nil
{
if
conn
==
nil
{
...
@@ -379,7 +378,7 @@ type txReq struct {
...
@@ -379,7 +378,7 @@ type txReq struct {
errch
chan
error
errch
chan
error
}
}
// errSendShutdown returns appropr
o
ate error when c.down is found ready in Send
// errSendShutdown returns appropr
i
ate error when c.down is found ready in Send
func
(
c
*
Conn
)
errSendShutdown
()
error
{
func
(
c
*
Conn
)
errSendShutdown
()
error
{
switch
{
switch
{
case
atomic
.
LoadUint32
(
&
c
.
closed
)
!=
0
:
case
atomic
.
LoadUint32
(
&
c
.
closed
)
!=
0
:
...
...
go/neo/connection_test.go
View file @
cb23e144
...
@@ -141,7 +141,7 @@ func xverifyPkt(pkt *PktBuf, connid uint32, msgcode uint16, payload []byte) {
...
@@ -141,7 +141,7 @@ func xverifyPkt(pkt *PktBuf, connid uint32, msgcode uint16, payload []byte) {
// (we cannot easily sync and make sure e.g. read is started and became asleep)
// (we cannot easily sync and make sure e.g. read is started and became asleep)
//
//
// XXX JM suggested to really wait till syscall starts this way:
// XXX JM suggested to really wait till syscall starts this way:
// - via polling get traceback for thread that is going to call syscall and eventuall block
// - via polling get traceback for thread that is going to call syscall and eventuall
y
block
// - if from that traceback we can see that blocking syscall is already called
// - if from that traceback we can see that blocking syscall is already called
// -> this way we can know that it is already blocking and thus sleep-hack can be avoided
// -> this way we can know that it is already blocking and thus sleep-hack can be avoided
// this can be done via runtime/pprof -> "goroutine" predefined profile
// this can be done via runtime/pprof -> "goroutine" predefined profile
...
...
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