[pull] main from getsentry:main - #402
Merged
Merged
Conversation
* fix(replay): Release MediaMuxer when the encoder fails to start The MediaMuxer is opened eagerly in SimpleVideoEncoder's constructor, but its release() was only reachable on paths that assume start() succeeded. Two cases leaked it: - createVideoOf constructed the encoder and called start() in one expression, so when start() threw the encoder was never assigned and release() could never run. - SimpleVideoEncoder.release() released the muxer as the last statement of the try block, after draining and stopping the codec. Draining a codec that never started throws, skipping the muxer release. Release the encoder if start() throws, and always release the muxer from a finally block so it is freed even when draining/stopping the codec fails. This surfaced as a CloseGuard "resource was acquired but never released" warning. Complements #5583. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * changelog * fix(replay): Skip MediaMuxer stop when no samples were written MediaMuxer.stop() throws IllegalStateException when the muxer was started but no sample was ever written to its track. SimpleMp4FrameMuxer.release() only guarded against the never-started case, so a started-but-empty muxer made release() throw. Because release() runs from SimpleVideoEncoder's finally block, that throw propagates out to createVideoOf, which treats release() as safe cleanup; the encoder is left dangling and the orphan video file is never deleted. Only call stop() when at least one sample was written; muxer.release() on a started-but-not-stopped muxer is safe. * Format code * fix(replay): Guard each native release so cleanup never propagates The finally block in SimpleVideoEncoder.release() released the codec, surface, and muxer without guards. release() is treated by callers such as createVideoOf as safe cleanup, but MediaMuxer.stop() (reached via frameMuxer.release()) can still throw IllegalStateException on a genuine file-finalization failure even when samples were written. That would skip the remaining releases and propagate out of release(). Guard each release independently so failing to free one resource neither skips the others nor escapes to the caller. --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
…behind isEnabled (#5790) * perf(android): Guard manifest metadata debug logs behind isEnabled (JAVA-614) The read helpers in ManifestMetadataReader built the debug message (key + " read: " + value) unconditionally at the call site, and DiagnosticLogger only filtered on options.isDebug() afterward. With debug=false (the default) that discarded ~100 StringBuilder/String allocations per init. Guard the six read helpers with logger.isEnabled(DEBUG) so the message is only constructed when debug logging is actually on. Behavior is unchanged; this is a pure allocation/GC-pressure reduction on the init path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * changelog --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Unit tests already target the release variant (testBuildType = release) and CI disabled the debug variant. Disable the debug variant locally too so local builds match CI and skip building the unused variant. The sample app keeps both variants for manual runs and profiling. Update the contributor docs and test skill to reference testReleaseUnitTest instead of testDebugUnitTest. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )