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(request-id): file descriptor overflow when use request-id plugin nanoid algorithm #11060

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

aikin-vip
Copy link
Contributor

Description

Fixes (#8931)

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

t/plugin/request-id3.t Outdated Show resolved Hide resolved
@@ -51,6 +51,22 @@ local schema = {
}
},
default = {}
},
nanoid = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this block needed when just replacing the dependency would fix the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new dependency provides more controllable parameters and more customized functions, so parameter options are added,just like range_id

if conf.algorithm == "nanoid" then
return nanoid.safe_simple()
return nanoid.generate(conf.nanoid.length,conf.nanoid.char_set)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space needed after comma

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space needed after comma

OK

[[{
"plugins": {
"request-id": {
"algorithm": "nanoid"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your PR suggests that usage method/configuration for nanoid has changed. Which means existing users will face incompatibility issues when upgrading to the newer version. We should avoid such a situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noticed the question you raised before submitting. I have already set the initial default value in the parameters, the default parameter value will be the same as the default value generated in previous versions without modifying the parameter value. Therefore, I think the upgrade should be smooth. Is there anything missing from me?


=== TEST 3: hit
--- request
GET /opentracing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add error log and status code checks here.

@shreemaan-abhishek shreemaan-abhishek added the wait for update wait for the author's response in this issue/PR label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wait for update wait for the author's response in this issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants