Skip to content

Limit calls to exit() #59338

Closed
Closed

Description

@zanderso

The Flutter CLI doesn't call exit() from many places today:

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/runner.dart#L256
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/base/signals.dart#L144

But if it were to start calling exit() from more places, various hard-to-find/racy shutdown inconsistencies could potentially crop up. See the discussion here:

#58474 (comment)

After removing the call to exit() here:

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/analyze_continuously.dart#L182

Calls to exit() could be limited using a forbidden_import_test after moving exit() from io.dart to, e.g. exit.dart.

/cc @jamesderlin @jonahwilliams

Activity

  1. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    toolAffects the "flutter" command-line tool. See also t: labels.
    P2Important issues not at the top of the work list
    on Jun 12, 2020
  2. added
    c: flakeTests that sometimes, but not always, incorrectly pass
    team-toolOwned by Flutter Tool team
    triaged-toolTriaged by Flutter Tool team
    on Jul 7, 2023
  3. self-assigned this
    on Jul 9, 2025
  4. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jul 9, 2025
  5. github-actions commented on Aug 1, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.c: flakeTests that sometimes, but not always, incorrectly passteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-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