Skip to content

Conversation

igordmn
Copy link
Collaborator

@igordmn igordmn commented May 9, 2025

Cherry-pick of https://android-review.googlesource.com/c/platform/frameworks/support/+/3586997

Besides cherry-pick, additional code added in the second commit.

Fixes https://youtrack.jetbrains.com/issue/CMP-7879/Cherry-pick-a-hotfix-for-deadlock-between-BroadcastFrameClock.lock-and-Recomposer.stateLock

Release Notes

Fixes - Desktop

  • Fix deadlock between BroadcastFrameClock.lock and Recomposer.stateLock

@igordmn igordmn force-pushed the igor.demin/deadlock-cherry-pick branch from ab55da5 to 2ab33b0 Compare May 9, 2025 22:20
In the referenced bug, there's a deadlock where
a call to `withFrameNanos` is being canceled on one thread while another
thread is dispatching another thread. To avoid the deadlock, this
commit updates the BroadcastFrameClock awaiter so that it's possible
to cancel an awaiter without acquiring any locks.

Fixes: b/407027032
Test: BroadcastFrameClockTest.locklessCancellation
Relnote: "Fixed a deadlock that may affect Molecule users when a
suspended call to `FrameClock.withFrameNanos` is cancelled while a
frame is being dispatched."

Change-Id: I89cab8e3eab14ed9a85b36e151f11b5f526a01fd
@igordmn igordmn force-pushed the igor.demin/deadlock-cherry-pick branch from 2ab33b0 to 67c7a07 Compare May 9, 2025 22:22
@igordmn igordmn force-pushed the igor.demin/deadlock-cherry-pick branch from 67c7a07 to 7480a26 Compare May 9, 2025 22:23
@igordmn igordmn requested a review from pjBooms May 9, 2025 23:04
@igordmn igordmn requested a review from Kpotko May 12, 2025 10:30
@Kpotko Kpotko merged commit 95fa354 into release/1.8 May 12, 2025
10 of 11 checks passed
@Kpotko Kpotko deleted the igor.demin/deadlock-cherry-pick branch May 12, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants