Skip to content

Commit

Permalink
CLI: increase body size on template render.
Browse files Browse the repository at this point in the history
A user reported that when a lot of services in K8s environment started
with apicast name, APICast cannot started because of the body size of
the template.

Because the body limit is set to nil, but liquid template set to 100000
[0] and started to fail in there.

The main reason to print all ENV variables on the nginx.conf, is because
the following code [1]

[0] https://github.com/3scale/liquid-lua/blob/a7f4119e96054f08df1fb8dce2be3469eb7ffb5f/lib/liquid.lua#L2675-L2686
[1] https://github.com/3scale/APIcast/blob/fba67b02200a4df231546145296927dea816c33f/gateway/http.d/init.conf#L46-L58

Fix THREESCALE-6315

Signed-off-by: Eloy Coto <[email protected]>
  • Loading branch information
eloycoto committed Nov 12, 2020
1 parent fba67b0 commit 5ee4a86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion gateway/src/apicast/cli/command/start.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ function mt:__call(options)
update_env(env)
-- also use env from the config file
update_env(context.env or {})

local nginx = nginx_config(context, template_path)

local log_level = get_log_level(self, options)
Expand Down
5 changes: 4 additions & 1 deletion gateway/src/apicast/cli/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ function _M:interpret(str)
local context = self.context
local filesystem = self.filesystem
local filter_set = FilterSet:new()
local resource_limit = ResourceLimit:new(nil, 1000, nil)
-- The 1000000 limit, is to increase the body limits. This was triggered by
-- a issue THREESCALE-6315 where a lot of ENV variables are render in the
-- nginx.conf file.
local resource_limit = ResourceLimit:new(1000000, 1000, nil)

local filesystem_cache = {}

Expand Down

0 comments on commit 5ee4a86

Please sign in to comment.