Jakarta-RS scope remains active after Tomcat request completes (TomEE/CXF), eventually exceeding scope depth
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- java
调研方向
Start with JakartaRsAnnotationsInstrumentation.java at the linked advice, then compare the Tomcat instrumentation and scope-manager sources against the v1.65.1 tag. Investigate which advice-exit path could leave the Jakarta-RS scope active after the servlet request, using the reported scope-depth and out-of-order-close symptoms; completion requires a reproducible diagnosis and confirmation that each request restores the worker scope depth.
由索引模型根据 Issue 内容生成。
描述
Tracer Version(s)
Datadog dd-trace-java v1.65.1 (official source compared). The debug capture is from a downstream-derived build; the official binary has not been independently run in this environment.
Java Version(s)
Java 17.0.9 / IBM OpenJ9 0.41.0
JVM Vendor
IBM SDK / Semeru
Bug Report
Context and upstream comparison
TomEE/Tomcat with CXF Jakarta-RS. I compared the affected build with the official Datadog v1.65.1 tag. The Jakarta-RS annotations instrumentation source tree, Tomcat instrumentation source tree, scope-manager source tree, ExtractedSpan.java, and LogbackLoggerInstrumentation.java are byte-for-byte identical. In particular, the Jakarta-RS advice in v1.65.1 has the same scope lifecycle code.
One downstream Logback event instrumentation file differs, so I am not claiming that the exact log output or missing correlation IDs have been reproduced with the official Datadog artifact. This report focuses on the scope-stack symptom. Source equivalence also does not, by itself, prove that the official binary exhibits the same runtime behavior.
Observed sequence in a sanitized tracer debug capture
- A Jakarta-RS span starts for an annotated resource method on a Tomcat worker.
- When the outer servlet request completes, closing its scope logs "scope when not on top" and identifies the still-active Jakarta-RS span as the current top. The example Jakarta-RS span has no matching finish record in the available capture.
- Similar out-of-order closes recur on worker threads. Later, activation of new request spans reports "Scope depth limit exceeded (100). Returning NoopScope."
Please investigate whether the Jakarta-RS advice can leave a resource-method scope active after the Tomcat request finishes in a TomEE/CXF deployment, and whether this behavior is already addressed upstream. The capture does not identify which specific advice-exit path was missed.
A related Logback null TraceConfig path is already addressed by #12413; that is not the requested fix here.
Expected Behavior
The Jakarta-RS scope closes before the outer servlet request scope, and each completed request leaves the worker scope stack at its original depth.
Reproduction Code
No standalone reproducer against the official Datadog binary is available yet. No customer logs or internal URLs are attached.
- 主要语言
- Java
- 星标
- 737
- 派生
- 361
- 平均合并
- 3 天 20 小时
- 30 天内合并 PR
- 173
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DataDog/dd-trace-java 的其他 Issue
-
type: feature request
难度 1/5 1-3 小时 新手友好度 70/100
DataDog/dd-trace-java#10245 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 62/100
DataDog/dd-trace-java#12608 ·
-
难度 4/5 3-5 天 新手友好度 35/100
DataDog/dd-trace-java#12540 · 4 条评论 · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 25/100
DataDog/dd-trace-java#12480 ·
-
comp: tooling type: bug report
DataDog/dd-trace-java#12469 · 1 个 reaction · 已指派 1 人 ·
查看 DataDog/dd-trace-java 的全部 Issue
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
inu-appcenter/memorIN-backend#288 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
frontend maui-pilot pilot-ask question
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·