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
aae27bf2
Commit
aae27bf2
authored
Jan 13, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c541c99c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
12 deletions
+14
-12
go/internal/task/task.go
go/internal/task/task.go
+8
-6
go/neo/client.go
go/neo/client.go
+1
-1
go/neo/storage.go
go/neo/storage.go
+1
-1
go/neo/t_cluster_test.go
go/neo/t_cluster_test.go
+3
-3
go/neo/t_tracego_test.go
go/neo/t_tracego_test.go
+1
-1
No files found.
go/internal/task/task.go
View file @
aae27bf2
// Copyright (C) 2017 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Copyright (C) 2017
-2021
Nexedi SA and Contributors.
//
Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
...
...
@@ -17,7 +17,7 @@
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
// Package task provides handy utilities to define &
log
tasks.
// Package task provides handy utilities to define &
trace
tasks.
package
task
import
(
...
...
@@ -46,19 +46,21 @@ func Runningf(ctxp *context.Context, format string, argv ...interface{}) func(*e
func
running
(
ctxp
*
context
.
Context
,
name
string
)
func
(
*
error
)
{
ctx
:=
taskctx
.
Running
(
*
ctxp
,
name
)
*
ctxp
=
ctx
log
.
Depth
(
2
)
.
Info
(
ctx
,
"start"
)
log
.
Depth
(
2
)
.
Info
(
ctx
,
"start"
)
// XXX log -> trace
return
func
(
errp
*
error
)
{
if
*
errp
!=
nil
{
// XXX is it good idea to log to error here? (not in above layer)
// XXX what is error here could be not so error above
// XXX or we still want to log all errors - right?
log
.
Depth
(
1
)
.
Warning
(
ctx
,
"## "
,
*
errp
)
// XXX "::" temp
//
// -> yes, we do want to trace unconditionally when a task is finished
// here it is tracing, just with trace sink being hardcoded to log.
log
.
Depth
(
1
)
.
Warning
(
ctx
,
"## "
,
*
errp
)
// XXX "##" temp
}
else
{
log
.
Depth
(
1
)
.
Info
(
ctx
,
"done"
)
}
// XXX do we need vvv if we log it anyway ^^^ ?
// NOTE not *ctxp here - as context pointed by ctxp could be
// changed when this deferred function is run
taskctx
.
ErrContext
(
errp
,
ctx
)
...
...
go/neo/client.go
View file @
aae27bf2
...
...
@@ -238,7 +238,7 @@ func (c *Client) talkMaster(ctx context.Context) (err error) {
// TODO if err = shutdown -> return
// exit on cancel / throttle reconnecting
// exit on cancel / throttle reconnecting
select
{
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
...
...
go/neo/storage.go
View file @
aae27bf2
...
...
@@ -180,7 +180,7 @@ func (stor *Storage) talkMaster(ctx context.Context) (err error) {
// TODO if err = shutdown -> return
// exit on cancel / throttle reconnecting
// exit on cancel / throttle reconnecting
select
{
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
...
...
go/neo/t_cluster_test.go
View file @
aae27bf2
...
...
@@ -52,7 +52,7 @@ type tEnv struct {
// Create it with tEnv.NewCluster.
// Create nodes with .NewMaster, .NewStorage and .NewClient.
//
// NOTE network addresses are predictable due to using pipenet/lonet for inter-networking.
// NOTE network addresses are predictable due to using pipenet/lonet for inter-n
ode n
etworking.
//
// XXX text about events tracing
type
tCluster
struct
{
...
...
@@ -379,7 +379,7 @@ func (m *tMaster) Run(ctx context.Context) error {
return
m
.
Master
.
Run
(
ctx
,
l
)
}
// -------
// -------
------------
// Verify verifies f for all combinations of node kinds.
// XXX place
...
...
@@ -408,7 +408,7 @@ func Verify(t *testing.T, f func(*tEnv)) {
}
// --------
// --------
------------
// tNewCluster_MS starts simple NEO cluster with 1 master and 1 storage nodes.
// The cluster is returned in ready-to-start state.
...
...
go/neo/t_tracego_test.go
View file @
aae27bf2
// Copyright (C) 2017-202
0
Nexedi SA and Contributors.
// Copyright (C) 2017-202
1
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
...
...
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