Comments (4)
This might be something in the daemon... I can repro this with the following code:
for (let i = 0; i < 10; i++) {
const process = safeSpawn(undefined, "C:\\Dev\\Tools\\Dart\\Nightly\\bin\\dart.exe", [
"tooling-daemon",
"--machine",
], {});
console.log(` Spawned PID: ${process.pid}`);
process.stdout.on("data", (data: Buffer | string) => console.log(data));
process.stderr.on("data", (data: Buffer | string) => console.error(data));
process.on("exit", (code, signal) => console.warn(code, signal));
process.on("error", (error) => console.error(error));
await new Promise((resolve) => setTimeout(resolve, 500));
process.kill();
console.log(` Killed PID: ${process.pid}`);
}
@CoderDake FYI - I'll try to repro from Dart to eliminate NodeJS weirdness.
from dart-code.
Of course it doesn't happen from the equivalent Dart code 😬 I'll keep looking! My money is going to be on shell we're using to spawn it not passing across the signal. This is why many of our tools advertise pids during startup... I think maybe we should do the same here.
from dart-code.
Yep, enabling the shell on Windows triggers it from Dart too:
import 'dart:convert';
import 'dart:io';
Future<void> main() async {
final vmPath = Platform.resolvedExecutable;
final args = [
'tooling-daemon',
'--machine',
];
for (int i = 0; i < 30; i++) {
final proc = await Process.start(vmPath, args, runInShell: true);
print('Started ${proc.pid}');
proc.stdout.transform(utf8.decoder).listen(print);
proc.stderr.transform(utf8.decoder).listen(print);
await Future.delayed(const Duration(milliseconds: 100));
proc.kill();
print('Killed ${proc.pid}');
}
}
The PIDs being printed here are the shell, not the Dart process.
@CoderDake any objections to putting the real PID inside the initial json?
{"pid":12345,"tooling_daemon_details":{"uri":"ws://127.0.0.1:53841/","trusted_client_secret":"apGxfEl4bIDvrYxR"}}
^^^^^
We do similar in DevTools server and other tools:
from dart-code.
For now, I'm going to bypass the shell for DTD - we know we don't need it. I've opened #5018 to see if we can bypass shells in other places to reduce the chance of possible leaving orphaned processes.
from dart-code.
Related Issues (20)
- "Don't show again" option for "Project contains issues that can be fixed by dart fix" prompt does not persist HOT 3
- Not able to "Go to Type Definition" in `for-in` loop variable HOT 1
- Variable hover should show the origin of the given type HOT 1
- Update syntax highlighting for digit separators
- Unable to open static DevTools extensions on current Flutter beta HOT 5
- Unable to copy using buttons in DevTools HOT 5
- Failure to read files from workspace roots via DTD on Windows HOT 5
- Breakpoint not hit on web after a hot reload in latest stable HOT 10
- Go to file keyboard binding doesn't work HOT 2
- Add a setting to completely disable using `pub` (no prompts, no automatic running, no commands/toolbar buttons) HOT 4
- ui guide not working in android studio HOT 1
- Possibility to filter internal debug log HOT 1
- Flutter daemon left orphaned after IDE was closed HOT 8
- Remove Widget also in list Widgets HOT 3
- Move to file not moving to existing file even after agreeing to replace it HOT 23
- VideoPlayerController Does not send headers when Ran from Web on a request requiring CORS HOT 1
- debugging isolates seems flakey HOT 6
- CTRL + Click `part of 'file.dart';` directive doesn't work without `part` directive HOT 4
- Refine: make the running panic stops at user code zone but not SDK/system code zone HOT 6
- Improve discoverability of additional args for testing HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-code.