Mark task worker span as failed when the task fails#69146
Open
dstandish wants to merge 2 commits into
Open
Conversation
uranusjr
reviewed
Jun 29, 2026
uranusjr
approved these changes
Jun 29, 2026
kaxil
reviewed
Jun 30, 2026
1 task
3bd0c7e to
b154f47
Compare
run() converts every task failure into a returned state plus error rather than re-raising, so the worker.<task_id> OTel span never observed the failure through exception propagation and was left with an unset status. Derive the span status from run()'s result so a failed task shows as an error in traces, consistently and regardless of trace detail level.
If the SIGALRM-based kill ever fails to fire, the test would otherwise block for the full sleep duration before failing with a not-raised error; 200ms bounds that worst case while staying well above the 10ms timeout.
21e7b21 to
0229bf6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run()converts every task failure into a returned state plus error rather than re-raising, so theworker.<task_id>OTel span never observed the failure through exception propagation and was left with an unset status. This derives the span status fromrun()'s result inmain(), where the worker span is in scope regardless of trace detail level, so a failed task consistently shows as an error in traces.Stacked on #67877 — the first commit in this diff belongs to that PR; review the top commit here (or review after #67877 merges and this is rebased).
closes: #69144
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines