Skip to content

Wrap ShutdownHook calls to avoid crashing the tool #171917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

matanlurey
Copy link
Contributor

Closes #57351.

@matanlurey matanlurey requested a review from bkonyi July 9, 2025 21:41
@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. d: docs/ flutter/flutter/docs, for contributors labels Jul 9, 2025
@github-actions github-actions bot removed the d: docs/ flutter/flutter/docs, for contributors label Jul 9, 2025
for (final ShutdownHook shutdownHook in registeredHooks) {
try {
final Future<void> future = asyncGuard<void>(
() async => shutdownHook(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this just be shutdownHook since ShutdownHook is just FutureOr<void> Function()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because asyncGuard requires Future<T> and shutdownHook is FutureOr<>.

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 17, 2025
Copy link
Contributor

auto-submit bot commented Jul 17, 2025

autosubmit label was removed for flutter/flutter/171917, because - The status or check suite Linux analyzer_benchmark has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 17, 2025
@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 17, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 17, 2025
Copy link
Contributor

auto-submit bot commented Jul 17, 2025

autosubmit label was removed for flutter/flutter/171917, because - The status or check suite Linux tool_integration_tests_1_7 has failed. Please fix the issues identified (or deflake) before re-applying this label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shutdown hooks shouldn't crash the tool
2 participants
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