Skip to content

Fuchsia Message Loop implementation is susceptible to idle wakes. #49330

Closed
@chinmaygarde

Description

@chinmaygarde

This is being temporarily reverted in flutter/engine#15903. Once the underlying issue (described below) is patched, this patch can be re-landed. The original regression was introduced in flutter/engine#14007.

The message loop implementations may be asked to wake up multiple times at various points in the future. When the implementation is asked to wake up the thread at the new time-point, the previous request must be disregarded. Once the time-point it reached, the implementation must call RunExpiredTasksNow. In the reverted patch, the Fuchsia implementation was scheduling a task to be run in the future for each call to MessageLoopImpl::WakeUp. This did not take into account disregarding the previous requests. Other platforms use timer file descriptors that are continuously re-armed to implement this functionality. In the absence of this mechanism on Fuchsia, for each task posted to the target message loop (potentially many thousands), the message loop would wake up and end up doing no work. This would eventually cause CPU usage to spike and cause actual work to be deferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listcustomer: fuchsiaengineflutter/engine repository. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions