Skip to content

[tool] Tool can accept/reject compilation results from a compilation after already sending out a second compilation request #152577

@andrewkolos

Description

@andrewkolos

Discovered while working on #152358. In this PR, I tried to change DefaultResidentCompiler to call flush on the stdin sink of the compiler frontend process after every writeln call.

However, this caused tests within hot_reload_web_test.dart to flake (or even fail fairly consistently depending on the host machine).

After instrumenting DefaultResidentCompiler with tracking and logging code, I was able to determine that the flakes occur due to a DefaultResidentCompiler::accept call being concurrent with a DefaultResidentCompiler::compileExpressionToJs call. (Unfortunately, I've lost this logging code, but you can at least see the failure in this old PR check).

While this issue was discovered in the hot reload for web tests, I don't believe this issue is specific to them.

#18618 modified DefaultResidentCompiler to force compilations to happen serially. However, nothing enforces that an accept or reject is sent to the compiler before the next compilation is sent off. I am not sure if this currently causing any bugs, but it seems like a pitfall that easily could.

I plan to workaround this issue in #152358 since troubleshooting and fixing it would block troubleshooting the top crasher of the flutter tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy