Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
67953d85
Commit
67953d85
authored
12 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
feature-script_dir: review fixes
parent
ec89190f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/tarantool_lua.m
+16
-21
16 additions, 21 deletions
src/tarantool_lua.m
test/box/configuration.result
+37
-0
37 additions, 0 deletions
test/box/configuration.result
test/box/configuration.test
+6
-4
6 additions, 4 deletions
test/box/configuration.test
with
59 additions
and
25 deletions
src/tarantool_lua.m
+
16
−
21
View file @
67953d85
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
/**
tarantool
start
-
up
file
*/
/**
tarantool
start
-
up
file
*/
#define
TARANTOOL
_
LUA
_
INIT
_
SCRIPT
"init.lua"
#define
TARANTOOL
_
LUA
_
INIT
_
SCRIPT
"init.lua"
struct
tarantool
_
cfg
cfg
;
struct
lua
_
State
*
tarantool
_
L
;
struct
lua
_
State
*
tarantool
_
L
;
/*
Remember
the
output
of
the
administrative
console
in
the
/*
Remember
the
output
of
the
administrative
console
in
the
...
@@ -1082,36 +1081,32 @@ static void
...
@@ -1082,36 +1081,32 @@ static void
load_init_script(void *L_ptr)
load_init_script(void *L_ptr)
{
{
struct lua_State *L = (struct lua_State *)
L
_
ptr
;
struct lua_State *L = (struct lua_State *)
L
_
ptr
;
struct
stat
st
;
char
path
[
PATH
_
MAX
]
;
char
path
[
PATH
_
MAX
+
1
]
;
snprintf
(
path
,
sizeof
(
path
)
,
"%s/%s"
,
snprintf
(
path
,
PATH
_
MAX
,
"%s/%s"
,
((
cfg
.
script
_
dir
)
?
cfg
.
script
_
dir
:
"."
)
,
cfg
.
script
_
dir
,
TARANTOOL
_
LUA
_
INIT
_
SCRIPT
)
;
TARANTOOL
_
LUA
_
INIT
_
SCRIPT
)
;
say
_
info
(
"trying to load %s"
,
path
)
;
/*
checking
that
Lua
start
-
up
file
exist
.
*/
if
(
access
(
path
,
F
_
OK
)
==
0
)
{
if
(
stat
(
path
,
&
st
))
{
say
_
info
(
"loading %s"
,
path
)
;
/*
/*
Execute
the
init
file
.
*/
*
File
doesn
'
t
exist
.
It
'
s
OK
,
tarantool
may
not
have
if
(
tarantool
_
lua
_
dofile
(
L
,
path
))
*
start
-
up
file
.
panic
(
"%s"
,
lua
_
tostring
(
L
,
-
1
))
;
*/
return
;
}
}
/*
/
*
execute
start
-
up
file
*/
*
The
file
doesn
'
t
exist
.
It
'
s
OK
,
tarantool
may
if
(
tarantool
_
lua
_
dofile
(
L
,
path
))
*
have
no
init
file
.
panic
(
"%s"
,
lua
_
tostring
(
L
,
-
1
))
;
*/
}
}
void
tarantool
_
lua
_
load
_
init
_
script
(
struct
lua
_
State
*
L
)
void
tarantool
_
lua
_
load
_
init
_
script
(
struct
lua
_
State
*
L
)
{
{
/*
/*
*
init
script
can
call
box
.
fiber
.
yield
(
including
implicitly
via
*
init
script
can
call
box
.
fiber
.
yield
(
including
implicitly
via
*
box
.
insert
,
box
.
update
,
etc
...
)
but
yield
which
called
in
sched
*
box
.
insert
,
box
.
update
,
etc
...
)
but
box
.
fiber
.
yield
()
today
,
*
fiber
will
crash
the
server
.
That
why
,
to
avoid
the
problem
,
we
must
*
when
called
from
'
sched
'
fiber
crashes
the
server
.
*
run
init
script
in
to
separate
fiber
.
*
To
work
this
problem
around
we
must
run
init
script
in
*
a
separate
fiber
.
*/
*/
struct
fiber
*
loader
=
fiber
_
create
(
TARANTOOL
_
LUA
_
INIT
_
SCRIPT
,
-
1
,
struct
fiber
*
loader
=
fiber
_
create
(
TARANTOOL
_
LUA
_
INIT
_
SCRIPT
,
-
1
,
load
_
init
_
script
,
L
)
;
load
_
init
_
script
,
L
)
;
...
...
This diff is collapsed.
Click to expand it.
test/box/configuration.result
+
37
−
0
View file @
67953d85
...
@@ -212,3 +212,40 @@ tarantool_box -c tarantool_bad_type.cfg
...
@@ -212,3 +212,40 @@ tarantool_box -c tarantool_bad_type.cfg
tarantool_box: can't load config:
tarantool_box: can't load config:
- (space = 0 fieldno = 0) index field type mismatch
- (space = 0 fieldno = 0) index field type mismatch
lua print_config()
---
io_collect_interval = 0
pid_file = box.pid
slab_alloc_minimal = 64
primary_port = 33013
log_level = 4
logger_nonblock = true
memcached_expire_per_loop = 1024
snap_dir = .
coredump = false
panic_on_snap_error = true
memcached_expire_full_sweep = 3600
replication_port = 0
wal_fsync_delay = 0
too_long_threshold = 0.5
slab_alloc_factor = 2
admin_port = 33015
logger = cat - >> tarantool.log
snap_io_rate_limit = 0
wal_writer_inbox_size = 16384
memcached_expire = false
backlog = 1024
memcached_space = 23
memcached_port = 0
rows_per_wal = 50
wal_mode = fsync_delay
local_hot_standby = false
secondary_port = 33014
panic_on_wal_error = false
script_dir = script_dir
wal_dir = .
bind_ipaddr = INADDR_ANY
readahead = 16320
slab_alloc_arena = 0.1
wal_dir_rescan_delay = 0.1
...
This diff is collapsed.
Click to expand it.
test/box/configuration.test
+
6
−
4
View file @
67953d85
...
@@ -63,17 +63,19 @@ sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool")
...
@@ -63,17 +63,19 @@ sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool")
server
.
test_option
(
"-c "
+
os
.
path
.
join
(
os
.
getcwd
(),
"box/tarantool_bad_type.cfg"
))
server
.
test_option
(
"-c "
+
os
.
path
.
join
(
os
.
getcwd
(),
"box/tarantool_bad_type.cfg"
))
sys
.
stdout
.
pop_filter
()
sys
.
stdout
.
pop_filter
()
# restore default server
server
.
stop
()
server
.
deploy
(
self
.
suite_ini
[
"config"
])
script_dir_path
=
os
.
path
.
join
(
vardir
,
"script_dir"
)
script_dir_path
=
os
.
path
.
join
(
vardir
,
"script_dir"
)
os
.
mkdir
(
script_dir_path
)
os
.
mkdir
(
script_dir_path
)
open
(
os
.
path
.
join
(
script_dir_path
,
"init.lua"
)
,
"w+"
)
.
close
(
)
shutil
.
copy
(
"box/test_init.lua"
,
os
.
path
.
join
(
script_dir_path
,
"init.lua"
))
server
.
stop
()
server
.
stop
()
server
.
deploy
(
"box/tarantool_scriptdir.cfg"
)
server
.
deploy
(
"box/tarantool_scriptdir.cfg"
)
exec
admin
"lua print_config()"
# restore default server
server
.
stop
()
shutil
.
rmtree
(
script_dir_path
,
True
)
shutil
.
rmtree
(
script_dir_path
,
True
)
server
.
deploy
(
self
.
suite_ini
[
"config"
])
# vim: syntax=python
# vim: syntax=python
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment