Repository navigation
fix(performance): close CPU, FPS and log collectors when their start is cancelled - #66
Merged
Merged
Conversation
…is cancelled Session starts now open through openRequestSession. A request cancelled during device validation opens nothing, a session that opens after cancellation or before an undelivered response is closed, and a delivered session keeps its normal lifetime.
lauridskern
marked this pull request as ready for review
October 29, 2026 14:59
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.
Summary
mobile_cpu_session,mobile_display_fps_sessionandmobile_logs_sessionopened their collector after device validation without checking for cancellation. A cancel during validation still started the collector, but the client never received itssessionId. For CPU, the per-app lock then blocked retries until the five-minute idle expiry.These starts now open through the existing
openRequestSessionhelper, which the simulator and mirror streams already use. A cancelled start opens nothing, a session that opens after cancellation or loses its response is closed, and a delivered session keeps its normal lifetime.Telemetry
The
safewrappers pass the request signal tocaptureServerError, so failures after cancellation count ascancelled. Cleanup failures use the existingstream.cancel_cleanupcapture, noted indocs/telemetry.md. Trace propagation and operation names are unchanged.Validation
packages/core/test/collector-startup.test.tscancels each start during validation, checks that no collector is left running, then checks that a delivered session stays readable. All three tests fail on the base commit and pass with the fix.node --test(new file pluscpu-tools,cpu-sessions,logs,physical-ios-logs,performance-recordings,telemetry): 67/67 pass.npm test: 897 pass, 1 skipped, 1 fail (existing test needing the absent Baguette binary).