Skip to content
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

[flutter_tools] tool does not run shutdown hooks when being sent SIGINT #134566

Closed
christopherfujino opened this issue Sep 12, 2023 · 1 comment · Fixed by #134590
Closed

[flutter_tools] tool does not run shutdown hooks when being sent SIGINT #134566

christopherfujino opened this issue Sep 12, 2023 · 1 comment · Fixed by #134590
Assignees
Labels
P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team triaged-tool Triaged by Flutter Tool team

Comments

@christopherfujino
Copy link
Member

Following on from discussion in https://github.com/flutter/flutter/pull/134493/files#r1323430358

It should be enough to send SIGINT to the tool, the tool should run all shutdown hooks.

@christopherfujino christopherfujino added P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team labels Sep 12, 2023
@christopherfujino christopherfujino self-assigned this Sep 12, 2023
@christopherfujino christopherfujino added the triaged-tool Triaged by Flutter Tool team label Sep 12, 2023
christopherfujino added a commit that referenced this issue Sep 13, 2023
Fixes #134566.

Prior to this fix, `ShutdownHooks` were run in the private helper
function `_exit()` defined in the `package:flutter_tools/runner.dart`
library. Independent of this, the tool had signal handling logic that
traps SIGINT and SIGTERM. However, these handlers called `exit()` from
`dart:io`, and didn't run these hooks.

This PR moves the `_exit()` private helper to
`package:flutter_tools/src/base/process.dart` and renames it to
`exitWithHooks()`, so that it can be called by the signal handlers in
`package:flutter_tools/src/base/signals.dart`.
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Mairramer pushed a commit to Mairramer/flutter that referenced this issue Oct 10, 2023
Fixes flutter#134566.

Prior to this fix, `ShutdownHooks` were run in the private helper
function `_exit()` defined in the `package:flutter_tools/runner.dart`
library. Independent of this, the tool had signal handling logic that
traps SIGINT and SIGTERM. However, these handlers called `exit()` from
`dart:io`, and didn't run these hooks.

This PR moves the `_exit()` private helper to
`package:flutter_tools/src/base/process.dart` and renames it to
`exitWithHooks()`, so that it can be called by the signal handlers in
`package:flutter_tools/src/base/signals.dart`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team triaged-tool Triaged by Flutter Tool team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant