Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[dev_setup] Fix memory leak in lua code in nginx
Change-Id: Ibba90d64bf606132d2f583eefbd6cc83b3e1e104
  • Loading branch information
Anfernee Gui committed Aug 16, 2012
1 parent 079a552 commit 83d4fc1
Showing 1 changed file with 3 additions and 9 deletions.
Expand Up @@ -40,6 +40,9 @@ http {

client_max_body_size 256M;

lua_package_path "<%= node[:lua][:module_path] %>/?.lua;;";
lua_package_cpath "<%= node[:lua][:module_path] %>/?.so;;";

upstream router_status {
server <%= node[:nginx][:uls_ip] %>:<%= node[:nginx][:uls_port] %>;
}
Expand Down Expand Up @@ -83,9 +86,6 @@ http {
# if we have multiple workers, there will be still few stats not synced for
# the workers which don't get this monitor request.
access_by_lua '
-- add package.path and package.cpath
package.path = package.path..";<%= node[:lua][:module_path] %>/?.lua"
package.cpath = package.cpath..";<%= node[:lua][:module_path] %>/?.so"
local uls = require ("uls")

ngx.log(ngx.DEBUG, "monitor trigger stats syncup")
Expand Down Expand Up @@ -118,9 +118,6 @@ http {
set $sticky '';

access_by_lua '
-- add package.path and package.cpath
package.path = package.path..";<%= node[:lua][:module_path] %>/?.lua"
package.cpath = package.cpath..";<%= node[:lua][:module_path] %>/?.so"
local uls = require ("uls")

uls.pre_process_subrequest(ngx, "<%= node[:router][:trace_key] %>")
Expand All @@ -139,9 +136,6 @@ http {

# Handling response from backend servers
header_filter_by_lua '
-- add package.path and package.cpath
package.path = package.path..";<%= node[:lua][:module_path] %>/?.lua"
package.cpath = package.cpath..";<%= node[:lua][:module_path] %>/?.so"
local uls = require ("uls")

uls.post_process_response(ngx)
Expand Down

0 comments on commit 83d4fc1

Please sign in to comment.