Skip to content

fix: unregister timer when snowflake etcd keepalive failed#8556

Merged
spacewander merged 2 commits into
apache:masterfrom
kingluo:reload_bugfix_request_id_plugin
Dec 26, 2022
Merged

fix: unregister timer when snowflake etcd keepalive failed#8556
spacewander merged 2 commits into
apache:masterfrom
kingluo:reload_bugfix_request_id_plugin

Conversation

@kingluo

@kingluo kingluo commented Dec 23, 2022

Copy link
Copy Markdown
Contributor

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
if err4 then
snowflake_inited = nil
data_machine = nil
timers.unregister_timer("plugin#request-id")

Copy link
Copy Markdown
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