shreemaan-abhishek opened a new pull request, #13633: URL: https://github.com/apache/apisix/pull/13633
### Description Follow-up to #13618. `_M.rewrite()` and `inject_core_spans()` build **different** tracers: `rewrite` uses the route's configured sampler, while `inject_core_spans` deliberately forces an `always_on` sampler so that, once a trace's root span is recording, the full internal core-span tree is kept unconditionally regardless of the route sampler. After #13618 both paths called `core.lrucache.plugin_ctx()` with the same extra key (`metadata.modifiedIndex`) on the same `api_ctx`, so they shared a single lrucache slot. On a warm worker, `rewrite` (rewrite phase) populates the slot first, and `inject_core_spans` (log phase) then reuses that route-sampler tracer instead of the `always_on` one it built, silently dropping the always_on guarantee for any sampler that is not trace_id-deterministic. This change namespaces the inject cache key (`inject_core_spans#<modifiedIndex>`) so the two tracers no longer collide, while preserving the rebuild-on-metadata-change behavior from #13618. It also hardens the regression test setup added in #13618 to fail fast when the admin update is rejected or the metadata never propagates to the worker, so the test cannot return `ok` on a broken setup and mask the real assertion. ### Checklist - [x] I have explained the need for this PR and the problem it solves - [x] I have explained the changes or the new features added to this PR - [x] I have added tests corresponding to this change - [x] I have updated the documentation to reflect this change (no doc change needed; internal behavior) - [x] I have verified that the changes are backward compatible -- 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]
