Skip to content

Commit

Permalink
fix(conf) drop lua_code_cache option
Browse files Browse the repository at this point in the history
This option no longer works, but triggers a lot of support
questions.
  • Loading branch information
Tieske committed Sep 9, 2017
1 parent 50f818e commit c7b4b48
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 23 deletions.
8 changes: 0 additions & 8 deletions kong.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,6 @@
# This includes the certificates configured
# for Kong's database connections.

#lua_code_cache = on # When disabled, every request will run in a
# separate Lua VM instance: all Lua modules
# will be loaded from scratch. Useful for
# adopting an edit-and-refresh approach while
# developing a plugin.
# Turning this directive off has a severe
# impact on performance.

#lua_package_path = # Sets the Lua module search path (LUA_PATH).
# Useful when developing or using custom
# plugins not stored in the default search
Expand Down
1 change: 0 additions & 1 deletion kong/conf_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ local CONF_INFERENCES = {
nginx_daemon = {typ = "ngx_boolean"},
nginx_optimizations = {typ = "boolean"},

lua_code_cache = {typ = "ngx_boolean"},
lua_ssl_verify_depth = {typ = "number"},
lua_socket_pool_size = {typ = "number"},
}
Expand Down
1 change: 0 additions & 1 deletion kong/templates/kong_defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ dns_not_found_ttl = 30
dns_error_ttl = 1
dns_no_sync = off
lua_code_cache = on
lua_socket_pool_size = 30
lua_ssl_trusted_certificate = NONE
lua_ssl_verify_depth = 1
Expand Down
1 change: 0 additions & 1 deletion kong/templates/nginx_kong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ underscores_in_headers on;
lua_package_path '${{LUA_PACKAGE_PATH}};;';
lua_package_cpath '${{LUA_PACKAGE_CPATH}};;';
lua_code_cache ${{LUA_CODE_CACHE}};
lua_socket_pool_size ${{LUA_SOCKET_POOL_SIZE}};
lua_max_running_timers 4096;
lua_max_pending_timers 16384;
Expand Down
13 changes: 6 additions & 7 deletions spec/01-unit/002-conf_loader_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ describe("Configuration loader", function()
it("infer booleans (on/off/true/false strings)", function()
local conf = assert(conf_loader())
assert.equal("on", conf.nginx_daemon)
assert.equal("on", conf.lua_code_cache)
assert.equal(30, conf.lua_socket_pool_size)
assert.True(conf.anonymous_reports)
assert.False(conf.cassandra_ssl)
Expand Down Expand Up @@ -188,19 +187,19 @@ describe("Configuration loader", function()
end)
it("infer ngx_boolean", function()
local conf = assert(conf_loader(nil, {
lua_code_cache = true
nginx_daemon = true
}))
assert.equal("on", conf.lua_code_cache)
assert.equal("on", conf.nginx_daemon)

conf = assert(conf_loader(nil, {
lua_code_cache = false
nginx_daemon = false
}))
assert.equal("off", conf.lua_code_cache)
assert.equal("off", conf.nginx_daemon)

conf = assert(conf_loader(nil, {
lua_code_cache = "off"
nginx_daemon = "off"
}))
assert.equal("off", conf.lua_code_cache)
assert.equal("off", conf.nginx_daemon)
end)
end)

Expand Down
3 changes: 0 additions & 3 deletions spec/01-unit/003-prefix_handler_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe("NGINX conf compiler", function()
it("compiles the Kong NGINX conf chunk", function()
local kong_nginx_conf = prefix_handler.compile_kong_conf(helpers.test_conf)
assert.matches("lua_package_path './?.lua;./?/init.lua;;;'", kong_nginx_conf, nil, true)
assert.matches("lua_code_cache on;", kong_nginx_conf, nil, true)
assert.matches("listen 0.0.0.0:9000;", kong_nginx_conf, nil, true)
assert.matches("listen 0.0.0.0:9001;", kong_nginx_conf, nil, true)
assert.matches("server_name kong;", kong_nginx_conf, nil, true)
Expand All @@ -67,13 +66,11 @@ describe("NGINX conf compiler", function()
end)
it("compiles with custom conf", function()
local conf = assert(conf_loader(helpers.test_conf_path, {
lua_code_cache = false,
mem_cache_size = "128k",
proxy_listen = "0.0.0.0:80",
admin_listen = "127.0.0.1:8001"
}))
local kong_nginx_conf = prefix_handler.compile_kong_conf(conf)
assert.matches("lua_code_cache off;", kong_nginx_conf, nil, true)
assert.matches("lua_shared_dict kong_cache%s+128k;", kong_nginx_conf)
assert.matches("listen 0.0.0.0:80;", kong_nginx_conf, nil, true)
assert.matches("listen 127.0.0.1:8001;", kong_nginx_conf, nil, true)
Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/02-cmd/03-compile_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ describe("kong compile", function()
local _, _, stdout = assert(helpers.kong_exec "compile")
assert.matches("init_by_lua_block", stdout)
assert.matches("init_worker_by_lua_block", stdout)
assert.matches("lua_code_cache on", stdout)
assert.matches("server_name kong", stdout)
assert.matches("server_name kong_admin", stdout)
assert.matches("listen 0.0.0.0:8000", stdout, nil, true)
Expand Down
1 change: 0 additions & 1 deletion spec/fixtures/custom_nginx.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ http {

lua_package_path '${{LUA_PACKAGE_PATH}};;';
lua_package_cpath '${{LUA_PACKAGE_CPATH}};;';
lua_code_cache ${{LUA_CODE_CACHE}};
lua_socket_pool_size ${{LUA_SOCKET_POOL_SIZE}};
lua_max_running_timers 4096;
lua_max_pending_timers 16384;
Expand Down

0 comments on commit c7b4b48

Please sign in to comment.