-
Notifications
You must be signed in to change notification settings - Fork 489
The watch
tasks seems to be running in the background even after the app is closed
#12
Comments
I can confirm the same under Windows 8.1. |
Ok, so it wasn't only my machine :) It happened randomly and rarely so I assumed this is some funkiness on my system. |
👍 - that seems to have fixed it |
Sorry I can't say the same, still experiencing the same |
@carlosperate are you sure you've killed all zombie processes of gulp watch started previously before trying this? |
Yeah, I just tried it on a fresh restart with a new clone of master and still the same.
I've experience both these issues from the beginning (a bit longer than a week ago is when I first used it), and it has not been intermittent. Testing on Windows 8.1 64 bit, running node 0.12.4 32 bit, and npm 2.10.1. |
Hah, it appears killing child process on Windows is harder than one might think. Could you try with 125b458 ? |
Yeah, that did the trick.
|
Great! I have no idea what this pipe error is, and it's generated from low level electron stuff (not a JS error), so I don't know if there is something I can do with it. |
Have you seen such pip error on your Windows testing? If so, could you raise a bug report in the appropriate channel? I have no idea how the software stack is organised, simple google search about it usually points to chromium build errors. |
I think this issue should be reopened. I am able to reproduce it with a fresh install of the boilerplate. I noticed it because after I close the electron-window the console does return and prints out right afterwards. [08:25:08] Starting gulpfile /path/to/gulpfile.js
[08:25:08] Starting 'watch'... again (after it already retorned to the working directory. See Screenshot below): After i noticed this, I tried to reproduce the issue using the steps provided by @floydpink wich works sometimes. Also, the build takes longer everytime I compile again. Also, after using Am I doing something wrong? |
Nah, it's the same here, too. I just got used to it. Gotta hit |
I've experienced the same. |
Why noone told then? :) |
While it's annoying you also get used to it pretty fast :D I recently had quite the same issue in one of my projects. I didn't find any satisfying solution. Tried pretty much any of these answers: http://stackoverflow.com/questions/23706055/why-can-i-not-kill-my-child-process-in-nodejs-on-windows Maybe this will do the trick: https://www.npmjs.com/package/tree-kill |
I think i've localized the possible issue: it's in I added some console-logs to make my point clear. see the attached console-screenshot* for an example... runGulpWatch respawns the process when watch is closed: var runGulpWatch = function () {
console.log('[runGulpWatch] Im getting spawned now')
watch = childProcess.spawn(utils.spawnablePath(gulpPath), [
'watch',
'--env=' + utils.getEnvName(),
'--color'
], {
stdio: 'inherit'
});
watch.on('close', function (code) {
// Gulp watch exits when error occured during build.
// Just respawn it then.
console.log('[runGulpWatch] Im restarting my self now')
runGulpWatch();
});
}; which is also triggered when the app exits by doing var runApp = function () {
var app = childProcess.spawn(electron, ['./build'], {
stdio: 'inherit'
});
app.on('close', function (code) {
// User closed the app. Kill the host process.
console.log('[runApp] Im killing gulps watch task right now ;)')
kill(watch.pid, 'SIGKILL', function () {
process.exit();
});
});
}; which seems to respawn the watch task (at least on windows): So from my point of view, the automatic respawn of |
This just sets a flag to prevent the watch task from being restarted when the user closes the application. Probably not a perfect long-term solution, but enough to get the gears turning again! Thanks goes out to @pkunze for finding the issue.
I've submitted a PR with a simple fix for the auto-restart when closing. It just sets a flag when it should not restart the watch task. The only question left is what happens when you forcefully stop the initial node process (hit |
If I remember correctly |
Yes |
I will try it later today or tomorrow and definitely let you know! |
So after removing |
@JimmyBoh if you think big count of files in |
Watch task has been refactored. Now using gulp-plumber and gulp-watch without creating child processes. Hope this solves all issues with watch task. Please give it a try. |
Try these steps to reproduce this issue:
npm install
at the root of the reponpm start
to start the electron app/app/hello_world/hello_universe.js
and savetranspile-watch
taskTesting this with the latest commit as of now on a Mac, with node and npm versions as below:
The text was updated successfully, but these errors were encountered: