Skip to content

Limit calls to exit() #59338

@zanderso

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

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