-
Notifications
You must be signed in to change notification settings - Fork 211
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
Kill NpmTask when gradle is stopped #238
Comments
This issue affects Grails 3.3.0 Angular projects when executed with client:bootRun. After the server is started via the gradle task, stopping the gradle task with Ctrl+C does not stop the The next time I go to start up the server, I get the "port is already in use" error. |
Just to summarize it. There is a workaround for this problem described in #143 (comment) ./gradlew watchWeb --no-daemon
<Ctrl+c>
ps aux | grep node
<node task is not running> ...although IMHO it's a workaround not a solution. That is why I do not close this issue. |
@mendlik this seems to be a limitation of Gradle daemon (gradle/gradle#1128) and I do not believe this can be fixed within the plugin. Maybe we could communicate the impact to the Gradle team to motivate them to provide a solution here. |
@orange-buffalo good idea. I have just created a topic on gradle discuss. Let's start there. |
any update on this issue ? |
With Gradle 4.8 it should now be possible to fix this issue by implementing the Cancellable Interface: |
This bothers us on the CI server (GitLab CI, but it does not matter I guess). If we cancel the build when the Node plugin is running already, it will finish the build anyway. While Gradle does not kill it, CI server waits for it and any next build is pending for many minutes. And we run the builds with |
Same here. We are running a server using an NPM script (npm start). Even by setting |
any update ? |
If anyone is interested in creating a solution to this there's further context in node-gradle/gradle-node-plugin#65 (comment) But this is something that should be fixed in Gradle and with Java 9+ it's supposedly easy to do. |
I also recently encountered this issue and I made a custom workaround based on Gradle Shared Build Services (https://docs.gradle.org/current/userguide/build_services.html). |
Hi, first of all thanks for a great gradle plugin.
One of my tasks in gradle starts an infinite node task called
watch
. This task is infinite it means it stops onCtrl + c
. Unfortunately when I kill gradle task the SIGKILL does not propagate to the npm task.Terminal execution:
Could you tell how to propagate the SIGKILL to npm task?
The text was updated successfully, but these errors were encountered: