-
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
fix(core): reduce uninitialized variable message when nginx return 400 #13201
Conversation
@oowl, did we consider defining those variables? E.g. move them to upper scope or something? Or skipping accessing them when we know they are not there (currently it feels like only reports.lua has this issue, so turning totally off feel like hitting a fly with a hammer)? Uninitialized warnings seems to be nice thing to catch some small issues? So turning it totally off feels like we will also miss something. |
7c5a012
to
5a8629e
Compare
5a8629e
to
50d6c66
Compare
changelog/unreleased/kong/fix-reports-uninitialized-variable-in-400.yml
Outdated
Show resolved
Hide resolved
…n-400.yml Co-authored-by: Zachary Hu <[email protected]>
5fb40f4
to
9ffe605
Compare
#13201) When Kong receives abnormal traffic, it will trigger 400 responses without initializing any Nginx variable, So it will trigger report.lua error, which is unnecessary. eg: send HTTP traffic to HTTPS port, Nginx will finalize the current request by 400 response in the TLS handshake, So it will never call any openresty HTTP processing phase, it also does not initialize any Nginx variable. Fix #13197 https://konghq.atlassian.net/browse/FTI-6025
#13201) When Kong receives abnormal traffic, it will trigger 400 responses without initializing any Nginx variable, So it will trigger report.lua error, which is unnecessary. eg: send HTTP traffic to HTTPS port, Nginx will finalize the current request by 400 response in the TLS handshake, So it will never call any openresty HTTP processing phase, it also does not initialize any Nginx variable. Fix #13197 https://konghq.atlassian.net/browse/FTI-6025
Summary
When Kong receives abnormal traffic, it will trigger 400 responses without initializing any Nginx variable, So it will trigger
report.lua
error, which is unnecessary.eg: send HTTP traffic to HTTPS port, Nginx will finalize the current request by 400 response in the TLS handshake, So it will never call any openresty HTTP processing phase, it also does not initialize any Nginx variable.
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix #13197
https://konghq.atlassian.net/browse/FTI-6025