Skip to content

[CP-stable][Impeller] Do not wait for a frame's acquire fence if the frame was never presented#183885

Merged
auto-submit[bot] merged 1 commit into
flutter:flutter-3.41-candidate.0from
flutteractionsbot:cp-stable-c5d0a84f88bdbd29e22408a9353be0d1690b0872
Mar 23, 2026
Merged

[CP-stable][Impeller] Do not wait for a frame's acquire fence if the frame was never presented#183885
auto-submit[bot] merged 1 commit into
flutter:flutter-3.41-candidate.0from
flutteractionsbot:cp-stable-c5d0a84f88bdbd29e22408a9353be0d1690b0872

Conversation

@flutteractionsbot

@flutteractionsbot flutteractionsbot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

Issue Link:

What is the link to the issue this cherry-pick is addressing?

b/488786379

Impact Description:

What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.

Changelog Description:

Explain this cherry pick:

  • In one line that is accessible to most Flutter developers.
  • That describes the state prior to the fix.
  • That includes which platforms are impacted.
    See best practices for examples.

< Replace with changelog description here >
flutter/183887 During SCREEN_OFF event a deadlock preventing new frames causing an ANR can occur on android devices running the Android 16 March Security update.

Workaround:

Is there a workaround for this issue?

No

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is tested by automated tests?

  • Yes
  • No

Validation Steps:

What are the steps to validate that this fix works?

No public repro steps.

…ever presented (flutter#183288)

This could happen if a previous call to vkAcquireNextImageKHR failed. If
that occurs, then AcquireNextDrawable will not return a surface. The
caller will not render a frame or call Present, and the fence will never
be signaled.

See internal issue b/488786379
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Mar 19, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor Author

@reidbaker please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard

Copy link
Copy Markdown

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Mar 19, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Mar 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the Vulkan swapchain implementation to avoid waiting on an acquisition fence if the frame was never presented. This is achieved by introducing a new flag, acquire_fence_pending, to track whether a fence wait is expected. The acquire fence is now created in an unsignaled state, and the acquire_fence_pending flag is set to true only when a frame is successfully submitted for presentation. The wait for the fence is skipped if this flag is not set, preventing a potential hang when acquiring the next drawable fails. The changes also include updates to the Vulkan mocking infrastructure to support a new unit test that validates this fix.

@reidbaker reidbaker requested a review from jason-simmons March 19, 2026 14:37
@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 23, 2026
@reidbaker reidbaker requested a review from walley892 March 23, 2026 17:39
@auto-submit auto-submit Bot merged commit 301b0e8 into flutter:flutter-3.41-candidate.0 Mar 23, 2026
162 checks passed
auto-submit Bot pushed a commit that referenced this pull request Mar 25, 2026
Update the changelog for 4.41.6. 

Includes: 
#183885 
#184040
#184025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 26, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Mar 26, 2026
Merge CHANGELOG.md into master for 3.41.6

includes:

#183885
#184040
#184025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 27, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 27, 2026
ahmedsameha1 pushed a commit to ahmedsameha1/flutter that referenced this pull request Apr 14, 2026
littleGnAl pushed a commit to littleGnAl/flutter that referenced this pull request Apr 15, 2026
…frame was never presented (flutter#183885)

This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

b/488786379

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.

### Changelog Description:
Explain this cherry pick:
* In one line that is accessible to most Flutter developers.
* That describes the state prior to the fix.
* That includes which platforms are impacted.
See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples.

< Replace with changelog description here >
[flutter/183887](flutter#183887) During SCREEN_OFF event a deadlock preventing new frames causing an ANR can occur on android devices running the Android 16 March Security update. 

### Workaround:
Is there a workaround for this issue?

No

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

No public repro steps.
Xbectordash pushed a commit to Xbectordash/abhi_flutter_fork that referenced this pull request May 13, 2026
…frame was never presented (flutter#183885)

This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

What is the link to the issue this cherry-pick is addressing?

b/488786379

What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.

Explain this cherry pick:
* In one line that is accessible to most Flutter developers.
* That describes the state prior to the fix.
* That includes which platforms are impacted.
See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples.

< Replace with changelog description here >
[flutter/183887](flutter#183887) During SCREEN_OFF event a deadlock preventing new frames causing an ANR can occur on android devices running the Android 16 March Security update.

Is there a workaround for this issue?

No

What is the risk level of this cherry-pick?

Are you confident that your fix is tested by automated tests?

What are the steps to validate that this fix works?

No public repro steps.
Xbectordash pushed a commit to Xbectordash/abhi_flutter_fork that referenced this pull request May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD cp: review Cherry-picks in the review queue e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants