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

chore(router) deprecate setting path handling v1 when router_flavor is traditional_compatible #9290

Merged

Conversation

windmgc
Copy link
Member

@windmgc windmgc commented Aug 23, 2022

Summary

This PR denies users from setting path_handling=v1 when the Kong gateway is running with router_flavor=traditional_compatible, as the path_handling feature is stepping into deprecation and path_handling v0 will be the default behaviour when composing upstream_uri.

Discussed with the team and decide to only print deprecation log in the current version.

Full changelog

  • Add custom entity check function to deny setting path_handling=v1 when router_flavor is traditional_compatible

@chronolaw
Copy link
Contributor

Good Job.

But I think both traditional_compatible and expression don't support v1, so we should change the condition to kong.configuration.router_flavor ~= "traditional"

@windmgc
Copy link
Member Author

windmgc commented Aug 23, 2022

@chronolaw Do you mean router_flavor = atc?

I saw that router_flavor only have three enum results

router_flavor = {
enum = { "traditional", "traditional_compatible", "atc" },
},

And when router_flavor = atc the schema will be a different table without the path_handling field in it

if kong and kong.configuration and kong.configuration.router_flavor == "atc" then
return {
name = "routes",
primary_key = { "id" },
endpoint_key = "name",
workspaceable = true,
fields = {
{ id = typedefs.uuid, },
{ created_at = typedefs.auto_timestamp_s },
{ updated_at = typedefs.auto_timestamp_s },
{ name = typedefs.utf8_name },
{ protocols = { type = "set",
len_min = 1,
required = true,
elements = typedefs.protocol,
mutually_exclusive_subsets = {
{ "http", "https" },
{ "tcp", "tls", "udp" },
{ "tls_passthrough" },
{ "grpc", "grpcs" },
},
default = { "http", "https" }, -- TODO: different default depending on service's scheme
}, },
{ https_redirect_status_code = { type = "integer",
one_of = { 426, 301, 302, 307, 308 },
default = 426, required = true,
}, },
{ strip_path = { type = "boolean", required = true, default = true }, },
{ preserve_host = { type = "boolean", required = true, default = false }, },
{ request_buffering = { type = "boolean", required = true, default = true }, },
{ response_buffering = { type = "boolean", required = true, default = true }, },
{ tags = typedefs.tags },
{ service = { type = "foreign", reference = "services" }, },
{ atc = { type = "string", required = true }, },
{ priority = { type = "integer", required = true, default = 0 }, },
},

@chronolaw
Copy link
Contributor

Now atc will rename to expression, see #9263 .

@chronolaw
Copy link
Contributor

I think it is not very urgent for 3.0, because the new router only supports v0.

@windmgc
Copy link
Member Author

windmgc commented Aug 23, 2022

Yes, agree, not a blocker for 3.0, so no hurry for merging.
And I still need to get the tests fixed :P

@windmgc windmgc changed the title chore(router) deny setting path handling v1 when router_flavor is traditional_compatible chore(router) deprecate setting path handling v1 when router_flavor is traditional_compatible Aug 25, 2022
@mayocream mayocream added this to the 3.0 milestone Aug 25, 2022
@windmgc windmgc force-pushed the chore-deny-path-handling-v1-on-trad-compat-flavor branch from 8c9908e to 4876a92 Compare August 25, 2022 05:54
autodoc/admin-api/data/admin-api.lua Outdated Show resolved Hide resolved
autodoc/admin-api/data/admin-api.lua Outdated Show resolved Hide resolved
autodoc/admin-api/data/admin-api.lua Outdated Show resolved Hide resolved
windmgc and others added 3 commits August 25, 2022 14:09
Co-authored-by: Datong Sun <dndx@idndx.com>
Co-authored-by: Datong Sun <dndx@idndx.com>
Co-authored-by: Datong Sun <dndx@idndx.com>
@guanlan guanlan merged commit 14296db into Kong:master Aug 25, 2022
locao pushed a commit that referenced this pull request Jun 21, 2024
### Summary

This fixes possible deadlock issue when worker is killed in middle of an event
execution that also acquires locks or mutexes (and then never releases them).

See:
- KAG-4480
- KAG-4586

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
(cherry picked from #13097)

Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants