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: use a new way to manage clean_handler #7648

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

spacewander
Copy link
Member

Signed-off-by: spacewander [email protected]

Description

Fixes #7633

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)

@spacewander spacewander marked this pull request as ready for review August 11, 2022 11:15
end

local id = item.clean_handlers._id
item.clean_handlers._id = item.clean_handlers._id + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

If item.clean_handlers._id is nil. The result will be two because we set item.clean_handlers._id = 1 at line 62.

Copy link
Member

Choose a reason for hiding this comment

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

What is the clean_handlers._id used for?

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the clean_handlers._id used for?

It is used to provide id for the handlers.

Copy link
Member Author

Choose a reason for hiding this comment

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

If item.clean_handlers._id is nil. The result will be two because we set item.clean_handlers._id = 1 at line 62.

Yes. But we store the id (which is assigned before item.clean_handlers._id = item.clean_handlers._id + 1), so the first id is still 1.

Copy link
Contributor

Choose a reason for hiding this comment

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

If item.clean_handlers._id is nil. The result will be two because we set item.clean_handlers._id = 1 at line 62.

Yes. But we store the id (which is assigned before item.clean_handlers._id = item.clean_handlers._id + 1), so the first id is still 1.

Got it.

@starsz starsz self-requested a review August 12, 2022 01:51
end

local id = item.clean_handlers._id
item.clean_handlers._id = item.clean_handlers._id + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

If item.clean_handlers._id is nil. The result will be two because we set item.clean_handlers._id = 1 at line 62.

Yes. But we store the id (which is assigned before item.clean_handlers._id = item.clean_handlers._id + 1), so the first id is still 1.

Got it.

@spacewander spacewander merged commit 768fc7c into apache:master Aug 15, 2022
Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: config_util.lua:71: attempt to call local 'f' (a nil value)
3 participants