Skip to content

fix: propagate execution-view invoke context - #820

Merged
zhongkechen merged 3 commits into
mainfrom
codex/otel-case11-replay
Oct 23, 2026
Merged

zhongkechen merged 3 commits into
mainfrom
codex/otel-case11-replay

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

Companion to aws/aws-durable-execution-conformance-tests#131. Merge the shared requirements PR first. The JavaScript handler counterpart is aws/aws-durable-execution-sdk-js#1068.

Description

Execution-view chained invokes omitted their operation trace header when a Java agent hid the concrete SdkTracerProvider. The child then inherited the service's execution-attempt parent instead of the SDK's otel-invoke span. This caused case 11 to fail on both X-Ray and S3, while the invocation view passed.

The agent-side post-autoconfiguration callback now checks the final sampler on the built, immutable tracer provider. Only that exact unwrapped DurableSampler instance can confirm consumption of the Invocation sampling intent. A filtering wrapper is rejected even when it delegates Invocation sampling to an inner DurableSampler. New configurations clear the old verification, and an absent callback leaves opaque propagation disabled. This uses the existing autoconfiguration SPI dependency.

Confirmation crosses the application/agent class-loader boundary through a scoped bridge, matches the trace, span name and execution ARN, and is cleared after span creation. Its distinct confirmation key rejects older agents that only observed sampler participation. The verified path propagates the deferred invoke’s deterministic parent ID with the actual invocation sampling flags. The change does not query sampling policy again, create a probe span, or modify another extension’s filter.

Case 11 also waits at otel-invoke-replay-barrier after the child returns, then returns the saved child result after resume. Both the shared orchestrator and requirement catalog are pinned to c32b40f5548f4776b7d533a76838e02358bc66d3 so CI exercises that scenario. The pinned long-running workflow remains a compatibility no-op.

Demo/Screenshots

The prior cloud run demonstrated the mismatch: https://github.com/aws/aws-durable-execution-sdk-java/actions/runs/40003569350. Each execution-view backend passed 25 cases and failed only case 11's Parent check; both invocation-view backends passed.

Checklist

  • I have filled out every section of the PR template
  • I have tested the change locally; updated cloud conformance runs separately in CI

Testing

Unit Tests

The complete OTel package passes 937 tests on Java 21. Coverage includes final sampler identity, later filtering wrappers, a missing post-build callback, stale verification, legacy agent confirmations, nested scope cleanup, sampled/unsampled decisions, and RECORD_ONLY behavior. Spotless passes.

Integration Tests

The filtering-wrapper regression reproduced two failures before the final-sampler check; all 16 direct/wrapped, visible/opaque, invocation/execution combinations now pass. Normal opaque agent providers and the application/agent class-loader split also pass, including explicit upstream decisions and delegated sampling.

The public invoke tests exercise three real invocations with a callback barrier, inspect the submitted XAmznTraceId, match its Parent to the exported invoke span, and verify replay sends no extra START or terminal export. The existing case-11 tests run the actual deployed handler in both tracing views.

The updated SDK/OTel artifacts and standalone conformance handler JAR build successfully. The new cloud run must still verify the service-reported carrier and complete X-Ray ancestry.

Examples

Updated the case-11 conformance handler and the propagation documentation.

@github-actions

This comment has been minimized.

@zhongkechen zhongkechen changed the title test: cover case 11 completed invoke replay fix: propagate execution-view invoke context Oct 23, 2026
@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 23, 2026 18:55 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 23, 2026 19:27 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

No actionable findings. The prior sampler-authority issue is addressed. Tests were not executed in this read-only review; actual agent initialization and cloud trace ancestry remain unverified.

Reviewed commit ffd2f8d1b62684579adf81b62b1a44cfa3b56367. Workflow run

@zhongkechen
zhongkechen merged commit 4b1aa82 into main Oct 23, 2026
30 checks passed
@zhongkechen
zhongkechen deleted the codex/otel-case11-replay branch October 23, 2026 20:03

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — ffd2f8d1 Deployed Oct 23, 2026 by zhongkechen via ai-pr-review / Codex review / Generate Codex review #2660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants