Repository navigation
fix(otel): preserve replay completion telemetry - #758
zhongkechen wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| with self._operation_spans_lock: | ||
| if info.operation_id in self._ended_operation_ids: | ||
| return |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Keep completion snapshots and export deduplication in each OTel invocation. Complete reentered replay segments, preserve missing-parent completions, and keep failed span starts retryable. Isolate plugin error snapshots and flush attempts by provider. Restore main-only CI filters; retain testing-wheel support downstream. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| for operation in pending: | ||
| self._render_operation_end(operation) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed in a5114c4. Both views now isolate completion failures during invocation End, allow one bounded ordinary retry, and finish other completions and root spans before reporting errors. Control exceptions are not retried or swallowed. Public-handler, nested-parent and permanent-failure regressions pass.
This comment has been minimized.
This comment has been minimized.
| for pending_end in pending_ends.values(): | ||
| self._render_operation_end(pending_end) |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_opkwyjxdk23t3ijca65noht5av
[P2] Isolate deferred export failures from parent scope setup
This drain runs inside on_user_function_start, before _attach_context. If a callback completed during suspension and its processor raises when replay registers the parent, _render_operation_end re-raises because _finalization is still None. Core contains that exception and executes the parent's body without attaching its OTel context, so user spans and correlated logs use the outer/invocation context. Later export retries cannot repair those spans. Contain ordinary failures per pending completion while retaining retry state and allowing parent setup to finish; add a replay regression with a processor that fails once.
To suppress repeats, reply /ai verdict deferred, /ai verdict false-positive, or /ai verdict out-of-scope on the first nonblank line. Add rationale on later lines. A new /ai verdict accepted allows future repeats again.
Codex AI reviewTwo P2 findings: Suppressed repeats
Reviewed commit |
A callback can complete while a durable function is suspended, and replay may never visit it. This change preserves telemetry for visible terminal operations using the existing plugin snapshots and hooks.
Changes
OperationInfo.from_operationconstructs the requested info subclass and copies mutable error stack traces. Terminal hooks use this conversion, so plugin mutations cannot alter checkpointed errors.Stack and scope
main → #758 → #795 → #796
The testing-library implementation is unchanged here, and installed-wheel checks use the published testing library. #795 carries replay visibility and successful-input acknowledgment fixes, local testing-wheel installation, and the CI filters needed by the remaining stack. All five workflow PR filters in #758 target only
main. #796 adds the conformance handlers and qualification coverage.Validation and limits
Validation on Python 3.13.17 passes:
The stack retains linear history. The additional #758 fix is carried into #795/#796 by rebasing their unchanged layer contents; independent tree checks verify those boundaries. Commit-message validation passes, with the accepted documentation suggestion and its coauthor attribution preserved. GitHub CI runs separately on the new pushed heads.
A processor can deliver a span and then raise, so retrying partial delivery can export it again. Deduplication is invocation-scoped; failed delivery can still be exported again after redelivery because durable state has no exporter acknowledgment. Shared conformance #131 remains a merge prerequisite. The separate virtual-FLAT replay persistence issue JS #997 remains outside this change.