Skip to content

fix #326 refresh naming cache on subscribe#330

Merged
KomachiSion merged 1 commit into
nacos-group:masterfrom
Sunrisea:fix/issue-326-naming-cache
Jul 6, 2026
Merged

fix #326 refresh naming cache on subscribe#330
KomachiSion merged 1 commit into
nacos-group:masterfrom
Sunrisea:fix/issue-326-naming-cache

Conversation

@Sunrisea

@Sunrisea Sunrisea commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix list_instances(subscribe=True) returning stale local naming cache when the service was loaded from disk but not subscribed to the server yet.
  • Align Python SDK behavior with Java client semantics: subscribe=true confirms subscription and refreshes cache, while subscribe=false queries the server directly.
  • Keep local cache fallback when subscribing from the server fails with a Nacos error.

Test plan

  • ./.venv/bin/python -m unittest test.test_naming_service_cache -v
  • ./.venv/bin/python -m unittest test.test_skill_and_prompt test.test_naming_service_cache -v
  • ./.venv/bin/python -m compileall v2/nacos/naming test/test_naming_service_cache.py
  • Local Nacos smoke test: stale disk cache with one real server instance refreshes correctly for subscribe=True and direct server query works for subscribe=False
  • Local Nacos smoke test: batch-register two instances, batch-deregister one instance, subscribed cache updates to one instance via server push

Closes #326

@KomachiSion KomachiSion merged commit 602ce2f into nacos-group:master Jul 6, 2026
6 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.

[Bug] list_instances 无法正确获取服务实例列表

2 participants