Skip to content

fix: healthcheck manager missing runtime information#12607

Merged
Revolyssup merged 32 commits into
apache:masterfrom
Revolyssup:revolyssup/fix-healthcheck-manager-nodever
Sep 16, 2025
Merged

fix: healthcheck manager missing runtime information#12607
Revolyssup merged 32 commits into
apache:masterfrom
Revolyssup:revolyssup/fix-healthcheck-manager-nodever

Conversation

@Revolyssup

@Revolyssup Revolyssup commented Sep 10, 2025

Copy link
Copy Markdown
Contributor
  • In case of service discovery, the node_ver information is not attached to the service received from etcd (due to deepcopy) therefore it's lost and healthchecker is not recreated.
  • In case of dns, dns_value is not attached to the data from etcd for similar reason.

Solution:

  • Since we use the data from etcd in healthcheck, we need the runtime information like nodes_ver and dns_value to be stored. This PR refactors the code so that those runtime updated values are persisted for future requests via healthcheck module.

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)

@Revolyssup
Revolyssup marked this pull request as draft September 10, 2025 10:16
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Sep 10, 2025
@Revolyssup
Revolyssup marked this pull request as ready for review September 10, 2025 18:17
@Revolyssup
Revolyssup requested review from bzp2010, membphis and nic-6443 and removed request for bzp2010 and membphis September 11, 2025 12:19
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 15, 2025
Comment thread apisix/core.lua Outdated
config = config,
config_util = require("apisix.core.config_util"),
sleep = utils.sleep,
fetch_latest_conf = fetch_latest_conf,

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.

in my opinion:

create a new module, it's name can be resource

then we can use it by call core.resource.get_nodes_ver, what do you think? @Revolyssup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread apisix/core/config_util.lua Outdated
return size
end

function _M.upstream_version(index, nodes_ver)

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.

move this function to upstream lua module

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done. moved to utils/upstream

@Revolyssup
Revolyssup requested a review from membphis September 15, 2025 10:17

@membphis membphis 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.

LGTM

@Revolyssup
Revolyssup merged commit 281d5e0 into apache:master Sep 16, 2025
36 of 47 checks passed
@Revolyssup
Revolyssup deleted the revolyssup/fix-healthcheck-manager-nodever branch September 16, 2025 07:37
jizhuozhi pushed a commit to jizhuozhi/apisix that referenced this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants