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: unregister timer when snowflake etcd keepalive failed #8556

Merged
merged 2 commits into from
Dec 26, 2022

Conversation

kingluo
Copy link
Contributor

@kingluo kingluo commented Dec 23, 2022

Description

Fixes #8520

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)

@kingluo kingluo changed the title bugfix: unregister timer when snowflake etcd keepalive failed fix: unregister timer when snowflake etcd keepalive failed Dec 23, 2022
@@ -129,6 +129,7 @@ local function gen_data_machine(max_number)
if err4 then
snowflake_inited = nil
data_machine = nil
timers.unregister_timer("plugin#request-id")
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a test to ensure the number of unregister_timer call is correct? For instance, via injecting some code.

@spacewander spacewander merged commit 8613265 into apache:master Dec 26, 2022
spacewander pushed a commit to spacewander/incubator-apisix that referenced this pull request Jan 28, 2023
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.

bug: timer leak in request-id plugin when reloaded
3 participants