-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
refactor(core) using new events library #8715
Changes from 177 commits
e241f6d
b6afdb5
2b5c72b
aead4cf
757b533
619b07d
30be16b
7576479
1f76e6c
2ac81a4
3752d72
06e281f
9e7576a
47fc24b
d660e81
e09b7f8
6139960
ba458db
2e32759
18f5143
0a629fe
b9b6dd0
5dd74ce
606021d
ca3a618
997ec27
489e184
4280adc
e8b8468
360c0b5
950b4ab
7fc820c
4be06df
5bfc4ec
fd10345
819c5d2
3136d49
7a687de
a5cc15c
226a169
c7c3608
69baeb9
9dd2919
c43a4a5
d52389d
7efa785
78eb71f
3abec6d
481cebe
57ed53b
0b52ed1
18eec32
e9f7d10
8a2acc4
ee1fc43
0b74248
11618f5
f0590b2
82db0b5
c15066d
6e6f071
56b3437
8359c45
b9a58cd
5ac79b2
e5bcd8c
43a47ca
14bf433
867b771
69c2499
a41acc7
9495500
fc8e72b
9ae57c4
7d5023d
84683b0
2ceb512
7fbfcb7
83e3cde
971397e
f4721cf
e485bbb
daef21a
3f8a0e8
42312b4
a011e86
da699ba
cc11eaf
a14c3a2
e56886f
4cb0423
82b2f77
eb06326
f33e272
9de8f33
0bf37c6
7141389
5bf2525
28bd9f2
4cde9dc
19b3b3d
e0ed39a
4af7630
7a789cf
5e148bd
80824f1
54963f1
e3cb7cd
47eab82
79ad3c8
f3ba060
e7e1095
1ef69d4
041525f
631d0da
4329280
8c38a2c
b3fd64c
e45423d
a8d541e
5b31db6
83faebd
1c70a5b
06e13c9
b68fcc9
0b2347e
ded8fc4
b012496
895c3ec
95c0d24
670b153
813fce0
920cf41
3e978b6
2fadd46
6eb45b6
e650be6
a42905b
dd2a739
1cfa103
40e6b20
fb9a11d
2f5af17
3c28127
107e2b6
d02ce23
7593116
a7dffbd
e8c819b
afa02a7
bf27c3f
cc805b6
61ccfce
d1b1de3
288fa03
707abce
449125a
9e0b308
6105bc7
64f513f
df97cb3
2fffc9d
dd2e20f
ff4300f
89f5a5c
aa72f40
a2d32bc
7eeb376
d346592
8c5688c
bc8e702
7c26b90
af4ff6b
21a2633
7b3feb7
44e2856
0fd27c7
ed2f26b
e3c83fd
65cc6d7
86d225a
0aa369e
5358a8b
349dae6
312dc88
cca21a6
628649b
dc496d4
91ab127
af83d06
9fb11c5
f2b6bbf
30ff547
9eaade5
b2d0b08
216f952
41c008e
d0e2f3f
987cb41
eb47f00
badb21a
9dc0b95
62b53c1
19860c8
0654dc5
4990387
87c2f15
c7b5444
311fa25
c31866a
690d99c
5a90e34
99a3350
a4afde5
58bde7a
8681de3
7f46e85
b2a67a1
374120e
523f084
0c4bd5c
2fb901b
0701841
22fb057
408ca0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,8 @@ RESTY_VERSION ?= `grep RESTY_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk | |
RESTY_LUAROCKS_VERSION ?= `grep RESTY_LUAROCKS_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'` | ||
RESTY_OPENSSL_VERSION ?= `grep RESTY_OPENSSL_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'` | ||
RESTY_PCRE_VERSION ?= `grep RESTY_PCRE_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'` | ||
KONG_BUILD_TOOLS ?= `grep KONG_BUILD_TOOLS_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'` | ||
#KONG_BUILD_TOOLS ?= `grep KONG_BUILD_TOOLS_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'` | ||
KONG_BUILD_TOOLS ?= feat/new_resty_events | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. acknowledge |
||
GRPCURL_VERSION ?= 1.8.5 | ||
OPENRESTY_PATCHES_BRANCH ?= master | ||
KONG_NGINX_MODULE_BRANCH ?= master | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -484,6 +484,9 @@ build = { | |
["kong.plugins.azure-functions.handler"] = "kong/plugins/azure-functions/handler.lua", | ||
["kong.plugins.azure-functions.schema"] = "kong/plugins/azure-functions/schema.lua", | ||
|
||
-- XXX: test only | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, remove before merging? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, Vini is working on new version health check library. |
||
["kong.resty.healthcheck"] = "kong/resty/healthcheck.lua", | ||
|
||
["kong.vaults.env"] = "kong/vaults/env/init.lua", | ||
["kong.vaults.env.schema"] = "kong/vaults/env/schema.lua", | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,16 +167,43 @@ end | |
function _GLOBAL.init_worker_events() | ||
-- Note: worker_events will not work correctly if required at the top of the file. | ||
-- It must be required right here, inside the init function | ||
local worker_events = require "resty.worker.events" | ||
local worker_events | ||
local opts | ||
|
||
local ok, err = worker_events.configure { | ||
shm = "kong_process_events", -- defined by "lua_shared_dict" | ||
timeout = 5, -- life time of event data in shm | ||
interval = 1, -- poll interval (seconds) | ||
local singletons = require "kong.singletons" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked the kong's code and have no idea about how to get the conf var, so I have to use |
||
|
||
wait_interval = 0.010, -- wait before retry fetching event data | ||
wait_max = 0.5, -- max wait time before discarding event | ||
} | ||
if singletons.configuration and | ||
singletons.configuration.events_mechanism == "shared_dict" then | ||
|
||
opts = { | ||
shm = "kong_process_events", -- defined by "lua_shared_dict" | ||
timeout = 5, -- life time of event data in shm | ||
interval = 1, -- poll interval (seconds) | ||
|
||
wait_interval = 0.010, -- wait before retry fetching event data | ||
wait_max = 0.5, -- max wait time before discarding event | ||
} | ||
|
||
worker_events = require "resty.worker.events" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather have the two There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. worker_events will not work correctly if required at the top of the file, It must be required right here, inside the init function |
||
|
||
else | ||
local sock_name = "worker_events.sock" | ||
if ngx.config.subsystem == "stream" then | ||
sock_name = "stream_" .. sock_name | ||
end | ||
|
||
opts = { | ||
unique_timeout = 5, -- life time of unique event data in lrucache | ||
broker_id = 0, -- broker server runs in nginx worker #0 | ||
listening = "unix:" .. -- unix socket for broker listening | ||
ngx.config.prefix() .. sock_name, | ||
} | ||
|
||
--worker_events = require "resty.events" | ||
worker_events = require "resty.events.compat" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even when we load the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the new API is a breaking change, we need to change many code in kong. Now I create this compatible layer only to try pass ci test. |
||
end | ||
|
||
local ok, err = worker_events.configure(opts) | ||
if not ok then | ||
return nil, err | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will almost certainly have to be changed before we can merge it, so leaving this comment as a reminder.