-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Spawned process pid not correct #6650
Comments
Could you explain what you mean? I tried this on OSX, yarn 1.12, node v8 and v10.13.0. I seem to get the pid that I would expect:
I'm not sure what you are seeing that you consider incorrect since you didn't include the output. Since it is your code in |
Btw you can see that under v1.11 the pids increment by 2. I suspect that this has something to do with the bug, as the logged pid is always in between 2 existing pids. Maybe the process was immediately closed and respawned or something, but still returning the old pid. |
strange. It shows up for me. I still don't think this would be a yarn issue. You are calling node's I would venture to guess that you would see the same behavior is you just ran |
side note, it probably jumps by 2 pids because yarn/node is invoked, and edit: actually you might get more processes than that, because you invoke yarn (1) which invokes your script through |
interesting that your pid shows a |
I'm on Sierra 10.12.4. I wonder if the OS difference has anything to do with it. Unfortunately I can't upgrade OSX on this laptop to try it out, as it doesn't belong to me. In your process monitor, if you show all processes, do you get an |
I was indeed filtering because i thought it would be a So the pid is not the wrong one, but the following code broke for me: function respawn() {
if (runner != null) {
runner.kill();
}
runner = child_process.spawn('node', ['build/backend/index.js'], {
stdio: [process.stdin, process.stdout, process.stderr],
});
} This functions gets called repeatedly when it should restart the process. |
Just came in here to say that this issue also bit us. We noticed this after we where having issues having the A webpack dev server restart correctly, and having the port being error out with in use. As @subhero24 mentioned, reverting back to 1.10 helped or simply running the script via npm. |
I just tried with using git@github.com:scherler/yarnWhitinYarn.git as mentioned in #6692 |
I'm also having issues with yarn berry (4.0.2) and Doing
It only happens if the spawned command is another yarn command (in my case running in a different cwd) |
Do you want to request a feature or report a bug?
Regression
What is the current behavior?
Spawning a process when using 'yarn run' reports the wrong pid for the spawned process
If the current behavior is a bug, please provide the steps to reproduce.
Repository with reproducable bug can be found here https://github.com/subhero24/yarn
What is the expected behavior?
When running 'yarn run spawn' it prints the pid of the spawned process, which is not the correct pid!
Please mention your node.js, yarn and operating system version.
The bug appears in yarn 1.11.0 and higher under macOS 10.14 with node v10.13.0
The text was updated successfully, but these errors were encountered: