Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: enabling both OTel views is accepted without mutual-exclusion validation

Đang mở
#758 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@zhongkechen đang làm issue này rồi.

Từ ngày 2/10/2026.

  • #766 của @zhongkechen — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java

Hướng nghiên cứu

Start with DurableConfig.java, DynamicPluginLoader.java, and PluginRunner.java to trace explicit, dynamic, and mixed registration, then inspect ExecutionOtelPlugin.java and InvocationOtelPlugin.java. Add focused validation and lifecycle tests for both registration orders, suspension/resume, success, failure, raw exports, and context restoration. Done means conflicting views are rejected before telemetry starts while valid combinations remain supported.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug needs-triage
Expected Behavior

At most one durable OTel view should be active for a handler invocation. InvocationOtelPlugin and ExecutionOtelPlugin are alternative views of the same execution and must not run together.

Reject the unsupported combination during configuration/registration with a clear diagnostic naming both views and explaining that the caller must keep one. Preserve valid single-view configurations and unrelated instrumentation plugins.

Actual Behavior

The current registration path accepts both built-in OTel views:

  • DurableConfig.Builder.withPlugins(...) accepts both instances; it checks null entries but does not enforce OTel-view exclusivity.
  • DynamicPluginLoader loads each requested provider and appends explicitly configured plugins. It rejects repeated provider names, but otel-invocation and otel-execution are different valid names.
  • PluginRunner retains the complete list and invokes every plugin's hooks in registration order. Each OTel view manages its own Workflow/Invocation spans and operation-parent model, so combining them can emit duplicate telemetry and competing context/log-correlation state.

Source inspected at d3208f2e759d3c79e84b46f53c2eb11fb7fe4c09:

Steps to Reproduce

This report is based on source inspection. The following validation recipe has not been executed for this report:

  1. Configure a recording OpenTelemetry provider with an in-memory exporter and sampling enabled; avoid an explicit upstream Sampled=0 suppressing the spans under test.

  2. Register both plugins explicitly:

    DurableConfig.builder()
        .withPlugins(new InvocationOtelPlugin(), new ExecutionOtelPlugin())
        .build();
    
  3. Run a handler containing one durable step through terminal completion. Observe that registration accepts both views and both receive hooks. Capture raw exported spans before backend deduplication.

  4. With the providers available on the class path, repeat using:

    DURABLE_EXECUTION_PLUGINS=otel-invocation,otel-execution
    
  5. Repeat with one view explicit and the other selected through the environment, then reverse their order.

Expected: a clear configuration diagnostic prevents both views from running. Current source accepts the combination; duplicate emission and context/MDC restoration should be pinned by focused runtime regression tests.

SDK Version

Current main source at d3208f2e759d3c79e84b46f53c2eb11fb7fe4c09.

Java Version

Not recorded: source inspection only; no new Java runtime reproduction was run for this report.

Is this a regression?

Unknown; no last working version with OTel-view exclusivity enforcement has been established.

Last Working Version

None identified.

Acceptance Criteria
  • Document that the two durable OTel views are mutually exclusive, including how to choose one.
  • Validate the explicit, dynamic/environment, and mixed registration paths after resolving the effective configuration. Cover both registration orders.
  • Reject the combination before either view begins emitting telemetry, with a diagnostic naming the conflicting views. If a different fail-safe policy is selected, document and test it; silently running both is not acceptable.
  • Keep zero-OTel-plugin configurations, either single view, and a single OTel view combined with unrelated plugins valid.
  • Use reusable exclusivity/registration metadata or an equivalent mechanism that does not require the core SDK to depend on OTel implementation classes. Checking duplicate provider names alone cannot reject two distinct views.
  • Test raw exports and context restoration: no duplicate Workflow/Invocation records from competing views, no conflicting operation parents, and no ended or other-view span left active for user logs/spans.
  • Cover the initial invocation and suspension/resume, including success and failure, without changing durable operation sequencing or replay behavior.
  • Apply the same constraint to any factory-based registration introduced by the plugin lifecycle migration; changing instance lifetime does not make the two views compatible.
Additional Context
  • Existing cross-SDK report: https://github.com/aws/aws-durable-execution-sdk-python/issues/652
  • This is a configuration-validation defect and does not require LMI or concurrent Lambda invocations.
  • Python #652 includes a Python-specific attach/detach ordering failure. This report does not claim that exact failure was reproduced in this language; validate context cleanup through this SDK's own lifecycle.
  • Align the diagnostic, supported combinations, documentation, and conformance expectations across JavaScript, Java, and Python.
Ngôn ngữ chính
Java
Star
28
Fork
13
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
44

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/aws-durable-execution-sdk-java

Tất cả issue của aws/aws-durable-execution-sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.