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

Closed
wants to merge 7 commits into 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
Copy link

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 16, 2024
Copy link

This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale wait for update wait for the author's response in this issue/PR
4 participants