Jakarta-RS scope remains active after Tomcat request completes (TomEE/CXF), eventually exceeding scope depth
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- observability-sre
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 736
- Fork
- 364
- Merge trung bình
- 3 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 204
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataDog/dd-trace-java
-
Update DEFAULT_HTTP_CLIENT_ERROR_STATUSES to include 5xx status codesCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởtype: feature request
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
DataDog/dd-trace-java#10245 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Startup ~2x slower with AOT class linking: agent retransforms ~22k preloaded classes (JDK 25, 1.67.0)Có thể đã có người làm @mcculls đã nhận 1 ngày trước. Đang mởtype: bug report
DataDog/dd-trace-java#12795 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
gRPC server instrumentations (grpc-1.5, armeria-grpc) don't make extracted W3C baggage current in the handlerCó thể đã có người làm @mcculls đã nhận 11 ngày trước. Đang mởcomp: context propagation inst: grpc type: feature request
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
DataDog/dd-trace-java#12654 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
DataDog/dd-trace-java#12608 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
DataDog/dd-trace-java#12480 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của DataDog/dd-trace-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
floci-io/floci#5369 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sqlcipher/sqlcipher-android#97 · 1 bình luận ·
-
bug IIIF interoperability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Netcracker/qubership-integration-platform#1046 ·
Maintainer thường phản hồi trong vòng 2 ngày