Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: Execution OTel view retains the ended attempt spanId in MDC

オープン
#815 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java

調査の方向性

Read ExecutionOtelPlugin.java around the Execution-view start and End hooks, then compare the MDC cleanup in InvocationOtelPlugin.java. Start by tracing scope and MDC handling across normal completion, failure, early returns, nested context, and suspension/resume. Add focused lifecycle assertions immediately after the End hook returns with MDC enabled, and verify that trace context is preserved and MDC-disabled behavior remains unaffected.

索引モデルが issue の本文から書いたものです。

説明

bug needs-triage
Expected Behavior

After ExecutionOtelPlugin.onUserFunctionEnd closes a completed attempt's OTel scope, MDC should no longer identify that ended attempt as the current span. Cleanup should happen before the hook returns, while preserving valid surrounding trace context.

Actual Behavior

Public main at 1c4922293d01bbd3a18082f0d9ea819a361a2227 injects the attempt span into MDC at user-function start, but the Execution-view End hook closes the OTel scope without removing its spanId from MDC. The Invocation-view End hook explicitly removes that key.

This creates a potential post-attempt correlation window in which a log can retain the ended attempt's span ID until later cleanup. The scope of this report is the missing cleanup at the End-hook boundary, not a claim of permanent or cross-invocation leakage.

Steps to Reproduce

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

  1. Configure the Execution OTel view with MDC enrichment enabled, a recording provider, and an MDC-capable SLF4J binding.
  2. In a focused lifecycle test, begin an invocation, an operation, and its user-function attempt on the owning thread. Record the attempt's span ID from MDC.
  3. Complete the user function and inspect MDC.get("spanId") immediately after onUserFunctionEnd returns, before any enclosing logger scope or invocation cleanup runs. Compare it with Span.current().
  4. Repeat with the Invocation view configured separately as a control.

Expected: MDC no longer reports the ended attempt's span ID. The source shows that only the Invocation-view End hook explicitly removes it.

SDK Version

Java SDK otel-plugin, public main at 1c4922293d01bbd3a18082f0d9ea819a361a2227.

Java Version

Not applicable to source inspection; no runtime reproduction was run for this report.

Is this a regression?

Unknown; no last working version has been established.

Acceptance Criteria
  • Remove or correctly restore the completed attempt's MDC span context before the Execution-view End hook returns; retain appropriate trace-level correlation.
  • Add a focused assertion immediately after the hook, before enclosing logger-scope cleanup can mask the defect. Cover normal completion, failure, and relevant early-return paths with MDC enabled.
  • Verify nested context restoration and suspension/resume, with the Invocation view as a control and MDC-disabled configurations unaffected.
主要言語
Java
スター
28
フォーク
16
平均マージ
2日 17時間
マージ済み PR(30日)
56

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/aws-durable-execution-sdk-java のほかの issue

aws/aws-durable-execution-sdk-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。