Commit cb23e144 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6c7942f1
...@@ -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 shutted 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 - becuase shutdown before // connTab is never nil here - because 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 approproate error when c.down is found ready in Send // errSendShutdown returns appropriate 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:
......
...@@ -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 eventually 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment