Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): shut down timers at the end of execution #9536

Merged
merged 3 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
the router's mutex is not released properly.
[#9480](https://github.com/Kong/kong/pull/9480)

#### CLI

- Fix slow CLI performance due to pending timer jobs
[#9536](https://github.com/Kong/kong/pull/9536)

#### Admin API

- Increase the maximum request argument number from `100` to `1000`, and return 400 error if request parameters reach the limitation to avoid being truncated.
Expand Down
9 changes: 9 additions & 0 deletions kong/cmd/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ math.randomseed() -- Generate PRNG seed
local pl_app = require "pl.lapp"
local log = require "kong.cmd.utils.log"

local function stop_timers()
-- shutdown lua-resty-timer-ng to allow the nginx worker to stop quickly
if _G.timerng then
_G.timerng:destroy()
end
end

local options = [[
--v verbose
--vv debug
Expand Down Expand Up @@ -99,4 +106,6 @@ return function(args)

pl_app.quit(nil, true)
end)

stop_timers()
end