Repository navigation
fix: export visible replay completions - #869
Draft
zhongkechen wants to merge 2 commits into
Draft
zhongkechen wants to merge 2 commits into
zhongkechen wants to merge 2 commits into
Conversation
3 tasks done
This branch has not been deployed
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.
Issue #, if available
Fixes #854.
Description of changes
A callback can complete while an execution is suspended, then be skipped when replay returns its parent's cached result. Both OTel views now retain visible terminal updates from invocation input and checkpoint changes, deliver them through the existing terminal span path, and export unvisited completions before Invocation closes.
Parent registration drains pending children under the actual replay segment. Completed parent contexts remain available for later updates, and invocation-end draining materializes pending ancestors before descendants. Successful observations are deduplicated per invocation; a newly opened Invocation-view ReplayChildren or virtual-context segment still receives its own natural End. A child processor failure during registration is logged without interrupting attachment of its parent's context.
This PR changes no core hook scheduling, testing-library behavior, status mapping, exception timestamps, provider flushing, or conformance handlers. Export recovery and finalization failure isolation remain #855; status/timestamp changes remain #853.
Design
parent_firstuses the standard-library topological ordering of pending updates. It does not add a second graph, repair cycles, manufacture missing operations, or treat non-recording references as proof that a terminal parent was exported.Assumptions
updated_operationscontains only metadata visible to the SDK. An ID without its operation cannot reconstruct a completion. Service-shaped fixtures exercise this boundary through the public handler, but deployed-service qualification is unverified in this PR.Validation
Python 3.13.17, Hatch 1.16.5:
main: 39 failed, 3 passed. The first commit contains those tests.hatch run dev-otel:test -q --tb=short: 853 passed before adding the final fixture/matrix extensions.hatch run dev-otel:typecheck: 52 source files clean.hatch fmt --checkin the OTel package andgit diff --check: passed.hatch build.hatch run test-wheel-otel:test -q --tb=short: 865 OTel tests and 12 lifecycle cases passed, with installed wheel hashes and source bytes verified. The final expanded snapshot set also passed separately against those installed wheels: 54 passed.Coverage includes input/checkpoint/natural deduplication; all terminal statuses; concurrent End/checkpoint delivery; full snapshots containing pending parent and child with an unavailable ancestor; actual replay parent preference and late updates; ReplayChildren/virtual segment re-entry; child processor isolation; cached-parent body skipping; unknown updated IDs; overlapping public invocations and warm reuse; and both public timed-branch replay and closing-batch concurrency.
No existing test expectations changed. New tests are adapted from the relevant #758 regressions, with populated-snapshot, overlap, and registration-failure cases added. The normal installed-wheel lane continues to use the testing dependency selected by the existing installer; changing that validation boundary belongs to #863.
Coordination with the other scoped fixes
Combined local validation with #865 (#853), #866 (#852), #867 (#861),
#868 (#860), and #870 (#862) passed 5,058 core/OTel/testing tests.
The composed OTel source also passed type checking (53 files) and formatting.
The branches remain independently based on main. Rebasing this PR after #865
and #866 requires resolving three overlapping hunks: retain both core README
paragraphs, use #853's normalized
end_timestampin Execution view's_finish_operation_endwhile retaining #854's parent registration throughspan.end, and passerror=info.errorto Invocation view's_end_spanbeforeretaining the completed parent reference. Those resolutions were used for the
combined validation; no exporter-retry or flush changes were added.
Decisions not covered by the issue or the design note
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.