You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User instrumentation in the root durable handler should join the canonical execution trace in both OTel views, including before/after nested operations and after resume. Preserve a valid same-trace ambient Lambda span; otherwise activate the view root (Workflow for execution view, Invocation for invocation view). Restore the previous context on the same handler thread on success, failure and suspension.
Actual behavior
The plugins select the canonical trace for SDK spans but never activate context around the root handler body. Nested callbacks have scopes, while root instrumentation sees either an invalid context or an unrelated ambient trace. SpanContext.isValid() alone does not detect the latter.
Java conformance PR #769, head078ce3b719f8bebf5fe5ab77a6f06c148fa3cf7f, exposes this in case22 on both views and both deployed backends (ADOT/X-Ray and Community/S3). Root probes conformance.handler, conformance.handler-restored, and conformance.handler-after-resume are absent from the canonical trace; nested callback probes pass. Deployed run: https://github.com/aws/aws-durable-execution-sdk-java/actions/runs/37079677202
A local public LocalDurableTestRunner regression also reproduces invalid root context without an agent on current main61f5d103, both sampled and unsampled, while the plugins already know the canonical trace. Supplying a different valid ambient trace reproduces incorrect trace membership.
Scope
Provide a focused nonbreaking core/plugin lifecycle capability. The scope must close on the handler thread: invocation end hooks can run on a different CompletableFuture completion thread. Preserve source/binary APIs, seven-component InvocationInfo, existing config/replay identities, released core/plugin combinations and separate plugin layers. Older cores may lack the new capability but must retain existing behavior. No major factory migration, handler-fixture parent binding, or weaker conformance assertions.
Related topology issue #644 handled SDK span parent selection, not root handler activation. #721 is the separate breaking plugin-lifetime migration. Coverage searches found no current implementation of this handler scope.
Fixed by #771, merged into main on 2026-10-13. Both OTel views now activate the canonical handler context, preserve compatible same-trace ambient context, and restore their owning scope on the handler thread after success, failure or suspension. The handler and its finally blocks remain within that lifecycle.
Verified the implementation and the HandlerContextIntegrationTest coverage on current main (2b2f930a), including nested work, resume, ambient-context restoration and reused workers. This uses the documented same-thread lifecycle capability introduced for core 2.2.2; matching updated core/plugin versions are required. Closing this root-handler context bug as completed.
Activity
zhongkechen commentedon Oct 15, 2026
Fixed by #771, merged into
mainon 2026-10-13. Both OTel views now activate the canonical handler context, preserve compatible same-trace ambient context, and restore their owning scope on the handler thread after success, failure or suspension. The handler and its finally blocks remain within that lifecycle.Verified the implementation and the
HandlerContextIntegrationTestcoverage on current main (2b2f930a), including nested work, resume, ambient-context restoration and reused workers. This uses the documented same-thread lifecycle capability introduced for core 2.2.2; matching updated core/plugin versions are required. Closing this root-handler context bug as completed.