Skip to content

internal: periodic collector DNS re-resolve (fork CI only) - #7

Open
songzhendong wants to merge 1 commit into
masterfrom
feat/periodic-dns-resolve
Open

songzhendong wants to merge 1 commit into
masterfrom
feat/periodic-dns-resolve

Conversation

@songzhendong

Copy link
Copy Markdown
Owner

Summary

  • Add SW_AGENT_COLLECTOR_IS_RESOLVE_DNS_PERIODICALLY + SW_AGENT_COLLECTOR_GRPC_CHANNEL_CHECK_INTERVAL (Java collector.is_resolve_dns_periodically / grpc_channel_check_interval parity).
  • When enabled, hostnames expand to static ipv4:/ipv6: dial targets and are re-checked on the interval; a changed IP set rebuilds the pick_first gRPC channel (sync daemon thread + aio watch task).
  • Unlike Java (resolve only while reconnecting), Python re-checks while connected so K8s Headless/Service IP churn is picked up without waiting for RPC failure.
  • Does not reintroduce Java-style single-index channel manager — keep native pick_first failover.

Test plan

  • tests/unit/test_dns_reresolve.py (plain vs force-expand, fingerprint stability, protocol rebuild)
  • Existing TestGrpcBackendAddress dual-stack expectation updated for sorted expand order
  • Fork CI unit matrix

Note: Fork-internal only; not for apache/skywalking-python upstream.

@songzhendong
songzhendong force-pushed the feat/periodic-dns-resolve branch 4 times, most recently from 1d9454e to 7e50e26 Compare September 13, 2026 14:20
Add SW_AGENT_COLLECTOR_IS_RESOLVE_DNS_PERIODICALLY and
SW_AGENT_COLLECTOR_GRPC_CHANNEL_CHECK_INTERVAL (Java collector.* parity).
When enabled, hostnames expand to static ipv4:/ipv6: dial targets and are
re-checked on the interval; any IP-set change (grow or shrink) rebuilds the
pick_first channel (sync thread + aio watch task).

Hardening: generation-scoped callbacks; DNS failure keeps previous dial plan;
sync/aio bind is atomic (construct then commit; abandon uncommitted channel);
sync rebuild restores the previous channel if subscribe fails after commit;
sync closes old channel only after successful bind and outside the lock;
aio begin_shutdown before task cancel; Event wake when old.close fails.

Unit coverage in test_dns_reresolve.py (sync + aio).
@songzhendong
songzhendong force-pushed the feat/periodic-dns-resolve branch 5 times, most recently from b0a48de to 06d65ae Compare September 14, 2026 03:04
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