Anon2Tokyo opened a new pull request, #1023: URL: https://github.com/apache/dubbo-go-pixiu/pull/1023
**What this PR does**: This PR addresses a few follow-up issues found after #1017 was merged: - Ignore stale endpoint removal events when the current cluster snapshot already contains the endpoint. - Preserve OpenTelemetry Baggage in Dubbo attachments when there is no span. - Fix incorrect Triple via-Pixiu data in `tools/benchmark/README_CN.md`. - Add a check to keep the English and Chinese Triple benchmark tables in sync. **Which issue(s) this PR fixes**: Follow-up fixes for #1017. **Special notes for your reviewer**: This change contains three independent follow-ups to #1017. 1. Endpoint removal event ordering `grpcConnectionManager` keeps tombstones for removed endpoints so an in-flight dial cannot publish an old connection after the endpoint has been removed. Tombstones are bounded, and eviction also removes the endpoint event version. The problematic sequence is: ```text endpoint A is removed -> A's tombstone is evicted after endpoint churn -> the current cluster snapshot contains A again -> an older remove callback arrives -> A is marked removed again because its old version watermark was evicted ``` A later request can see A in the cluster snapshot but still fail in `pinEndpoint` with `grpc endpoint was removed`. The removal path now checks the current cluster snapshot before recording a `present=false` event. If the endpoint is currently present, the callback is stale and is ignored. This keeps tombstone state bounded instead of retaining every endpoint version indefinitely. Covered by `TestGRPCConnectionManagerIgnoresStaleRemovalAfterTombstoneEviction`. 2. Baggage propagation in Dubbo attachments `withAttachments` previously returned the original context when tracing was disabled, there were no business attachments, and the context had no valid `SpanContext`. That is not enough to determine whether a propagator has work to do. A propagator can inject OpenTelemetry Baggage without a span. For example, a context containing only `tenant=blue` previously reached the Dubbo invocation without a `baggage` attachment. The fast path now injects into a temporary carrier first. It returns the original context only when the carrier remains empty. The carrier allocates its backing map lazily, so no attachment map is created when there is nothing to propagate. Covered by `TestWithAttachmentsPropagatesBaggageWithoutSpanWhenTracingDisabled`. 3. Triple benchmark documentation The Chinese README labeled Triple direct values as `via Pixiu` for `GetUser` and `GetUsers`. The values now match the Triple via-Pixiu rows in the English README. `TestTripleBenchmarkReadmesAgree` compares the documented direct and via-Pixiu Triple rows between the English and Chinese README files to catch future drift. Tests: ```text go test ./pkg/filter/http/grpcproxy -run '^TestGRPCConnectionManager(IgnoresStaleRemovalAfterTombstoneEviction|RejectsEvictedRemovedEndpointFromSnapshot|BoundsEndpointTombstones)$' -count=1 -timeout 30s go test ./pkg/client/dubbo -run '^TestWithAttachmentsPropagates(BaggageWithoutSpanWhenTracingDisabled|ExternalSpanWhenTracingDisabled)$' -count=1 -timeout 30s cd tools/benchmark && go test . -run '^TestTripleBenchmarkReadmesAgree$' -count=1 -timeout 30s ``` **Does this PR introduce a user-facing change?**: ```release-note Fixes stale endpoint removal handling and preserves OpenTelemetry Baggage in Dubbo proxy requests. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
