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
9c342579
Commit
9c342579
authored
10 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
startup: A quick fix for broken double initialization of listen port.
parent
cac3cb59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/box/lua/load_cfg.lua
+8
-1
8 additions, 1 deletion
src/box/lua/load_cfg.lua
test/box/cfg.result
+9
-9
9 additions, 9 deletions
test/box/cfg.result
with
17 additions
and
10 deletions
src/box/lua/load_cfg.lua
+
8
−
1
View file @
9c342579
...
...
@@ -131,6 +131,13 @@ local dynamic_cfg = {
snapshot_count
=
box
.
internal
.
snapshot_daemon
.
set_snapshot_count
,
}
local
dynamic_cfg_skip_at_load
=
{
wal_mode
=
true
,
listen
=
true
,
replication_source
=
true
,
}
local
function
prepare_cfg
(
cfg
,
default_cfg
,
template_cfg
,
modify_cfg
,
prefix
)
if
cfg
==
nil
then
return
{}
...
...
@@ -255,7 +262,7 @@ local function load_cfg(cfg)
ffi
.
C
.
load_cfg
()
for
key
,
fun
in
pairs
(
dynamic_cfg
)
do
local
val
=
cfg
[
key
]
if
val
~=
nil
then
if
val
~=
nil
and
not
dynamic_cfg_skip_at_load
[
key
]
then
fun
(
cfg
[
key
])
if
val
~=
default_cfg
[
key
]
then
log
.
info
(
"set '%s' configuration option to '%s'"
,
key
,
val
)
...
...
This diff is collapsed.
Click to expand it.
test/box/cfg.result
+
9
−
9
View file @
9c342579
...
...
@@ -2,7 +2,7 @@
--# push filter 'admin: .*' to 'admin: <uri>'
box.cfg.nosuchoption = 1
---
- error: '[string "-- load_cfg.lua - internal file..."]:25
1
: Attempt to modify a read-only
- error: '[string "-- load_cfg.lua - internal file..."]:25
8
: Attempt to modify a read-only
table'
...
t = {} for k,v in pairs(box.cfg) do if type(v) ~= 'table' and type(v) ~= 'function' then table.insert(t, k..': '..tostring(v)) end end
...
...
@@ -36,7 +36,7 @@ t
-- must be read-only
box.cfg()
---
- error: '[string "-- load_cfg.lua - internal file..."]:
197
: bad argument #1 to ''pairs''
- error: '[string "-- load_cfg.lua - internal file..."]:
204
: bad argument #1 to ''pairs''
(table expected, got nil)'
...
t = {} for k,v in pairs(box.cfg) do if type(v) ~= 'table' and type(v) ~= 'function' then table.insert(t, k..': '..tostring(v)) end end
...
...
@@ -70,23 +70,23 @@ t
-- check that cfg with unexpected parameter fails.
box.cfg{sherlock = 'holmes'}
---
- error: '[string "-- load_cfg.lua - internal file..."]:1
53
: Error: cfg parameter
- error: '[string "-- load_cfg.lua - internal file..."]:1
60
: Error: cfg parameter
''sherlock'' is unexpected'
...
-- check that cfg with unexpected type of parameter failes
box.cfg{listen = {}}
---
- error: '[string "-- load_cfg.lua - internal file..."]:1
73
: Error: cfg parameter
- error: '[string "-- load_cfg.lua - internal file..."]:1
80
: Error: cfg parameter
''listen'' should be one of types: string, number'
...
box.cfg{wal_dir = 0}
---
- error: '[string "-- load_cfg.lua - internal file..."]:1
6
7: Error: cfg parameter
- error: '[string "-- load_cfg.lua - internal file..."]:17
4
: Error: cfg parameter
''wal_dir'' should be of type string'
...
box.cfg{coredump = 'true'}
---
- error: '[string "-- load_cfg.lua - internal file..."]:1
6
7: Error: cfg parameter
- error: '[string "-- load_cfg.lua - internal file..."]:17
4
: Error: cfg parameter
''coredump'' should be of type boolean'
...
--------------------------------------------------------------------------------
...
...
@@ -94,17 +94,17 @@ box.cfg{coredump = 'true'}
--------------------------------------------------------------------------------
box.cfg{slab_alloc_arena = "100500"}
---
- error: '[string "-- load_cfg.lua - internal file..."]:1
6
7: Error: cfg parameter
- error: '[string "-- load_cfg.lua - internal file..."]:17
4
: Error: cfg parameter
''slab_alloc_arena'' should be of type number'
...
box.cfg{sophia = "sophia"}
---
- error: '[string "-- load_cfg.lua - internal file..."]:16
1
: Error: cfg parameter
- error: '[string "-- load_cfg.lua - internal file..."]:16
8
: Error: cfg parameter
''sophia'' should be a table'
...
box.cfg{sophia = {threads = "threads"}}
---
- error: '[string "-- load_cfg.lua - internal file..."]:1
6
7: Error: cfg parameter
- error: '[string "-- load_cfg.lua - internal file..."]:17
4
: Error: cfg parameter
''sophia.threads'' should be of type number'
...
--------------------------------------------------------------------------------
...
...
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