Skip to content

fix(build): reclaim expired prometheus shared dict entries - #170

Merged
wklken merged 1 commit into
TencentBlueKing:masterfrom
wklken:fix/prometheus-expired-shared-dict
Jul 24, 2026
Merged

fix(build): reclaim expired prometheus shared dict entries#170
wklken merged 1 commit into
TencentBlueKing:masterfrom
wklken:fix/prometheus-expired-shared-dict

Conversation

@wklken

@wklken wklken commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Description

Backport the physical shared-dict reclamation fix from api7/nginx-lua-prometheus#18.

The existing cleanup removes only worker-local key-index references. Expired metric values and index slots can continue occupying shared-dict slab pages under label churn, causing prometheus-metrics usage to grow without recovering. The build patch calls flush_expired() after the existing expiry scan.

Related:

Verification

  • Patch dry-run with --fuzz=0 against both apache/apisix:3.16.0-redhat and apache/apisix:3.17.0-redhat
  • Built bk-apigateway-apisix:prometheus-flush-master-codex from this branch
  • Verified the built APISIX 3.17.0 image contains exactly one self.dict:flush_expired() call in prometheus_keys.lua
  • LuaJIT bytecode compilation of the patched file succeeded
  • RUN_WITH_IT= make lint: 0 warnings / 0 errors
  • RUN_WITH_IT= make test: Busted 752 successes; test-nginx 681 tests, all successful

Checklist

  • 填写 PR 描述及相关 issue (write PR description and related issue)
  • 代码风格检查通过 (code style check passed)
  • PR 中包含单元测试 (include unit test) — dependency patch; upstream PR contains regression tests
  • 单元测试通过 (unit test passed)
  • 本地开发联调环境验证通过 (local development environment verification passed)

@wklken
wklken merged commit 3808f0c into TencentBlueKing:master Jul 24, 2026
3 checks passed
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.

1 participant