diff --git a/.requirements b/.requirements index 346d65fd07df..a499f0b54d86 100644 --- a/.requirements +++ b/.requirements @@ -21,7 +21,7 @@ ATC_ROUTER=ffd11db657115769bf94f0c4f915f98300bc26b6 # 1.6.2 SNAPPY=23b3286820105438c5dbb9bc22f1bb85c5812c8a # 1.2.0 KONG_MANAGER=nightly -NGX_WASM_MODULE=91d447ffd0e9bb08f11cc69d1aa9128ec36b4526 +NGX_WASM_MODULE=da0bb1726cd82e8e21ea1f93645fe1b06c2e6a28 WASMER=3.1.1 WASMTIME=19.0.0 V8=12.0.267.17 diff --git a/kong/runloop/wasm.lua b/kong/runloop/wasm.lua index af9bbc2cbae8..aa352927c9b8 100644 --- a/kong/runloop/wasm.lua +++ b/kong/runloop/wasm.lua @@ -945,13 +945,6 @@ function _M.attach(ctx) return kong.response.error(500) end end - - jit.off(proxy_wasm.start) - ok, err = proxy_wasm.start() - if not ok then - log(CRIT, "failed to execute ", chain.label, " filter chain for request: ", err) - return kong.response.error(500) - end end diff --git a/spec/02-integration/20-wasm/01-admin-api_spec.lua b/spec/02-integration/20-wasm/01-admin-api_spec.lua index 6ca6d75798c1..a613cfd2d14f 100644 --- a/spec/02-integration/20-wasm/01-admin-api_spec.lua +++ b/spec/02-integration/20-wasm/01-admin-api_spec.lua @@ -22,6 +22,8 @@ describe("wasm admin API [#" .. strategy .. "]", function() local service, route lazy_setup(function() + helpers.clean_prefix() + require("kong.runloop.wasm").enable({ { name = "tests", path = FILTER_PATH .. "/tests.wasm", @@ -547,6 +549,8 @@ describe("wasm admin API - wasm = off [#" .. strategy .. "]", function() local service lazy_setup(function() + helpers.clean_prefix() + bp, db = helpers.get_db_utils(strategy, { "routes", "services", diff --git a/spec/02-integration/20-wasm/04-proxy-wasm_spec.lua b/spec/02-integration/20-wasm/04-proxy-wasm_spec.lua index ce637af87f6b..de19fdab8689 100644 --- a/spec/02-integration/20-wasm/04-proxy-wasm_spec.lua +++ b/spec/02-integration/20-wasm/04-proxy-wasm_spec.lua @@ -136,6 +136,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() database = strategy, nginx_conf = "spec/fixtures/custom_nginx.template", wasm = true, + wasm_filters = "tests", dns_hostsfile = hosts_file, plugins = "pre-function,post-function", })) @@ -152,7 +153,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() describe("runs a filter chain", function() it("with a single filter", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -166,7 +167,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("with multiple filters", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -182,7 +183,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() describe("filters can", function() it("add request headers", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -203,7 +204,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("remove request headers", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -223,7 +224,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("add response headers on_request_headers", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -243,7 +244,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("add response headers on_response_headers", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -266,7 +267,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() -- describe+it: -- "filters can NOT ..." it("NOT add response headers on_log", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -286,7 +287,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() pending("throw a trap", function() -- Used to work but now broken (obscure wasmtime SIGSEV), no clue - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -303,7 +304,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) pending("send a local response", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -322,7 +323,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.client.protocol", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -342,7 +343,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.nginx.subsystem", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -362,7 +363,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.node.id", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -382,7 +383,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.node.memory_stats", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -402,7 +403,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.request.forwarded_host", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -422,7 +423,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.request.forwarded_port", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -442,7 +443,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.request.forwarded_scheme", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -462,7 +463,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) pending("read kong.response.source", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -483,7 +484,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.router.route", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -504,7 +505,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.router.service", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -525,7 +526,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("write kong.service.target", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local target = helpers.mock_upstream_host .. ":" .. @@ -551,7 +552,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() -- target is being set to mock_upstream:15555 instead of -- 127.0.0.1:1555 as expected... pending("write kong.service.upstream", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -572,7 +573,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("write kong.service.request.scheme", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -591,7 +592,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) pending("read kong.service.response.status", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -612,7 +613,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("write kong.response.status", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -633,7 +634,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.configuration", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -653,7 +654,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.route_id", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -673,7 +674,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.service_id", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -693,7 +694,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("read kong.ctx.shared[]", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -715,7 +716,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("write kong.ctx.shared[]", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -737,7 +738,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("clear kong.ctx.shared[]", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -759,7 +760,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) it("send an http dispatch, return its response body", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -787,7 +788,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() end) pending("resolves DNS hostnames to send an http dispatch, return its response body", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -819,7 +820,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() pending("start on_tick background timer", function() -- Pending on internal ngx_wasm_module changes - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send { @@ -837,7 +838,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function() describe("behavior with", function() pending("multiple filters, one sends a local response", function() - local client = helpers.proxy_client() + local client = helpers.proxy_client(5000) finally(function() client:close() end) local res = assert(client:send {