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
Show 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.
// Copyright (C) 2017
-2021
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// This program is free software: you can Use, Study, Modify and Redistribute
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
// See COPYING file for full licensing terms.
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
// 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
package
task
import
(
import
(
...
@@ -46,19 +46,21 @@ func Runningf(ctxp *context.Context, format string, argv ...interface{}) func(*e
...
@@ -46,19 +46,21 @@ func Runningf(ctxp *context.Context, format string, argv ...interface{}) func(*e
func
running
(
ctxp
*
context
.
Context
,
name
string
)
func
(
*
error
)
{
func
running
(
ctxp
*
context
.
Context
,
name
string
)
func
(
*
error
)
{
ctx
:=
taskctx
.
Running
(
*
ctxp
,
name
)
ctx
:=
taskctx
.
Running
(
*
ctxp
,
name
)
*
ctxp
=
ctx
*
ctxp
=
ctx
log
.
Depth
(
2
)
.
Info
(
ctx
,
"start"
)
log
.
Depth
(
2
)
.
Info
(
ctx
,
"start"
)
// XXX log -> trace
return
func
(
errp
*
error
)
{
return
func
(
errp
*
error
)
{
if
*
errp
!=
nil
{
if
*
errp
!=
nil
{
// XXX is it good idea to log to error here? (not in above layer)
// 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 what is error here could be not so error above
// XXX or we still want to log all errors - right?
// 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
{
}
else
{
log
.
Depth
(
1
)
.
Info
(
ctx
,
"done"
)
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
// NOTE not *ctxp here - as context pointed by ctxp could be
// changed when this deferred function is run
// changed when this deferred function is run
taskctx
.
ErrContext
(
errp
,
ctx
)
taskctx
.
ErrContext
(
errp
,
ctx
)
...
...
go/neo/client.go
View file @
aae27bf2
go/neo/storage.go
View file @
aae27bf2
go/neo/t_cluster_test.go
View file @
aae27bf2
...
@@ -52,7 +52,7 @@ type tEnv struct {
...
@@ -52,7 +52,7 @@ type tEnv struct {
// Create it with tEnv.NewCluster.
// Create it with tEnv.NewCluster.
// Create nodes with .NewMaster, .NewStorage and .NewClient.
// 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
// XXX text about events tracing
type
tCluster
struct
{
type
tCluster
struct
{
...
@@ -379,7 +379,7 @@ func (m *tMaster) Run(ctx context.Context) error {
...
@@ -379,7 +379,7 @@ func (m *tMaster) Run(ctx context.Context) error {
return
m
.
Master
.
Run
(
ctx
,
l
)
return
m
.
Master
.
Run
(
ctx
,
l
)
}
}
// -------
// -------
------------
// Verify verifies f for all combinations of node kinds.
// Verify verifies f for all combinations of node kinds.
// XXX place
// XXX place
...
@@ -408,7 +408,7 @@ func Verify(t *testing.T, f func(*tEnv)) {
...
@@ -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.
// tNewCluster_MS starts simple NEO cluster with 1 master and 1 storage nodes.
// The cluster is returned in ready-to-start state.
// 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>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// 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