Skip to content

fix: checker leak for domain nodes#9090

Merged
spacewander merged 2 commits into
apache:masterfrom
kingluo:bugfix_checker_leak
Mar 21, 2023
Merged

fix: checker leak for domain nodes#9090
spacewander merged 2 commits into
apache:masterfrom
kingluo:bugfix_checker_leak

Conversation

@kingluo

@kingluo kingluo commented Mar 16, 2023

Copy link
Copy Markdown
Contributor

Description

Fixes #8932

Only route.value.upstream.parent has table reference to route, so skip it in deepcopy to fix this bug and also avoid a recursive copy (27c37b1).

  dns_value = {
    create_time = 1678955679,
    id = "1",
    plugins = {
      ["serverless-pre-function"] = {
        functions = {...},
        phase = "before_proxy"
      }
    },
    priority = 0,
    status = 1,
    update_time = 1678955679,
    upstream = <1>{
      checks = {
        active = {...}
      },
      hash_on = "vars",
      nodes = <2>{ {...}, {...} },
      nodes_ref = <table 2>,
      original_nodes = <table 2>,
      parent = <3>{
        checker = {...},
        checker_idx = 1,
        checker_upstream = <table 1>,
        clean_handlers = {...},
        createdIndex = 2688845,
        has_domain = true,
        key = "/apisix/routes/1",
        modifiedIndex = 2688845,
        orig_modifiedIndex = 2688845,
        update_count = 0,
        value = {...}
      },
      pass_host = "pass",
      scheme = "http",
      type = "roundrobin"
    },
    uri = "/get"
  },

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 marked this pull request as ready for review March 16, 2023 09:13

@spacewander spacewander left a comment

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.

Let's merge master to make CI pass.

Comment thread t/node/healthcheck-leak-bugfix.t Outdated
apisix = require("apisix")
core = require("apisix.core")
apisix.http_init()

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.

We can use the new extra_init_by_lua so the lines above are not needed.

@kingluo
kingluo force-pushed the bugfix_checker_leak branch from de388b0 to a77902f Compare March 20, 2023 06:21
@spacewander
spacewander merged commit 8e9c051 into apache:master Mar 21, 2023
AlinsRan pushed a commit to AlinsRan/apisix that referenced this pull request Jun 25, 2023
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: checker leak for domain nodes?

3 participants