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
533d3a3e
Commit
533d3a3e
authored
Sep 11, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7877e55c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
6 deletions
+17
-6
go/gmigrate.go
go/gmigrate.go
+3
-1
go/neo/client/client.go
go/neo/client/client.go
+1
-0
go/neo/connection.go
go/neo/connection.go
+3
-0
go/neo/neo.go
go/neo/neo.go
+6
-2
go/neo/server/storage.go
go/neo/server/storage.go
+1
-0
go/neo/t/t.sh
go/neo/t/t.sh
+1
-1
go/neo/t/zsha1.go
go/neo/t/zsha1.go
+2
-2
No files found.
go/gmigrate.go
View file @
533d3a3e
// gmigrate - show number of times G migrates to another M (OS thread).
// usage: `go tool trace -d <trace.out> |gmigrate`
package
main
// +build ignore
package
main
import
(
"bufio"
"errors"
...
...
go/neo/client/client.go
View file @
533d3a3e
...
...
@@ -88,6 +88,7 @@ func NewClient(clusterName, masterAddr string, net xnet.Networker) *Client {
// spawn background process which performs master talk
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
cli
.
talkMasterCancel
=
cancel
cli
.
node
.
OnShutdown
=
cancel
// XXX ok?
go
cli
.
talkMaster
(
ctx
)
return
cli
...
...
go/neo/connection.go
View file @
533d3a3e
...
...
@@ -1146,6 +1146,9 @@ func (c *Conn) Recv() (Msg, error) {
// TODO use free-list for decoded messages + when possible decode in-place
msg
:=
reflect
.
New
(
msgType
)
.
Interface
()
.
(
Msg
)
// msg := reflect.NewAt(msgType, bufAlloc(msgType.Size())
_
,
err
=
msg
.
neoMsgDecode
(
pkt
.
Payload
())
if
err
!=
nil
{
return
nil
,
&
ConnError
{
Conn
:
c
,
Op
:
"decode"
,
Err
:
err
}
// XXX "decode:" is already in ErrDecodeOverflow
...
...
go/neo/neo.go
View file @
533d3a3e
...
...
@@ -31,7 +31,6 @@ import (
"context"
"fmt"
"net"
"os"
"sync"
"lab.nexedi.com/kirr/go123/xerr"
...
...
@@ -69,6 +68,9 @@ type NodeApp struct {
NodeTab
*
NodeTable
// information about nodes in the cluster
PartTab
*
PartitionTable
// information about data distribution in the cluster
ClusterState
ClusterState
// master idea about cluster state
// should be set by user so NodeApp can notify when master tells this node to shutdown
OnShutdown
func
()
}
// NewNodeApp creates new node application
...
...
@@ -346,7 +348,9 @@ func (app *NodeApp) UpdateNodeTab(ctx context.Context, msg *NotifyNodeInformatio
if
nodeInfo
.
State
==
DOWN
{
log
.
Info
(
ctx
,
"master told us to shutdown"
)
log
.
Flush
()
os
.
Exit
(
1
)
app
.
OnShutdown
()
// os.Exit(1)
return
}
}
}
...
...
go/neo/server/storage.go
View file @
533d3a3e
...
...
@@ -94,6 +94,7 @@ func (stor *Storage) Run(ctx context.Context) error {
// start serving incoming connections
wg
:=
sync
.
WaitGroup
{}
serveCtx
,
serveCancel
:=
context
.
WithCancel
(
ctx
)
stor
.
node
.
OnShutdown
=
serveCancel
wg
.
Add
(
1
)
go
func
(
ctx
context
.
Context
)
(
err
error
)
{
defer
wg
.
Done
()
...
...
go/neo/t/t.sh
View file @
533d3a3e
...
...
@@ -75,7 +75,7 @@ Sgo() {
# -alsologtostderr
exec
-a
Sgo
\
neo
-log_dir
=
$log
storage
-cluster
=
$cluster
-bind
=
$Sbind
-masters
=
$Mbind
"
$@
"
&
neo
-
cpuprofile
cpu.out
-
log_dir
=
$log
storage
-cluster
=
$cluster
-bind
=
$Sbind
-masters
=
$Mbind
"
$@
"
&
}
...
...
go/neo/t/zsha1.go
View file @
533d3a3e
// zsha1 - compute sha1 of whole latest objects stream in a ZODB database
package
main
// +build ignore
package
main
import
(
"context"
"crypto/sha1"
...
...
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