GoogleCloudPlatform / gradle-appengine-plugin

Gradle plugin that provides tasks for uploading, running and managing Google App Engine projects
Apache License 2.0
236 stars 60 forks source link

gradle appengineStop does not end related java process #223

Open samcarecho opened 8 years ago

samcarecho commented 8 years ago

Here are my settigns: Gradle 2.8 gradle-appengine-plugin 1.9.30 JDK 1.7.0_79

The issue: After working for a few hours, the command "gradle appengineStop" no longer terminates the related java process, and I have to terminate it manually so the port is freed.

Could this be a bug or could it be a problem related to how I installed Gradle and the JDK?

loosebazooka commented 8 years ago

Interesting. It shouldn't be a problem. What commands are you running? On Jan 9, 2016 18:29, "Sam Carecho" notifications@github.com wrote:

Here are my settigns: Gradle 28 gradle-appengine-plugin 1930 JDK 170_79

The issue: After working for a few hours, the command "gradle appengineStop" does not terminate the related java process, and I have to terminate it manually so the port is freed

Could this be a bug or could it be a problem related to how I installed Gradle and the JDK?

— Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/gradle-appengine-plugin/issues/223 .

samcarecho commented 8 years ago

From the OS (Linux) console, I run both:

gradle appengineRun --stacktrace
gradle appengineStop

Notice: I configured Gradle to run as a Daemon.

loosebazooka commented 8 years ago

I can't seem to reproduce using jdk 1.7, gradle 2.8 and appengine-plugin 1.9.30

Was it after a few hours of starting and stopping the server?

samcarecho commented 8 years ago

It seems to happen after a few hours working on a project.

loosebazooka commented 8 years ago

Hrmm.. when it happens next can you run (replace 8080 with whatever port you're using)

curl --data "" http://localhost:8080/_ah/admin/quit

I don't know if this will actually change anything though, since it seems like your server is shutdown but the java process is still alive somehow?

It doesn't look like the code that is starting the process is doing anything particularly weird. Have you ever seen this problem before?

samcarecho commented 8 years ago

@loosebazooka I will try it, but you are probably right about the server getting shutdown and the process somehow keeping alive.

The problem is recurrent, It happens from time to time for quite a while now. If I properly recall, the first time I got this problem was about a year ago.

One thing that I have noticed is that when the Java process starts not getting terminated, if I reboot the machine everything gets back to normal and it takes a few days or even a couple of weeks before the problem recur.

Before posting here, I've searched Google regarding the issue. Even though I've not found any thing related to Gradle, it seems that the issue is or was a recurring problem for Eclipse users developing for Appengine. Could that be somehow related?

Here is one of the links that I found: https://code.google.com/p/appengine-maven-plugin/issues/detail?id=11

Cheers.

patflynn commented 8 years ago

Is it possible that your application has a hanging non-daemon thread that's preventing the shutdown? You could use jps and jstack to check.

On Fri, Jan 15, 2016 at 5:23 PM, Sam Carecho notifications@github.com wrote:

@loosebazooka https://github.com/loosebazooka I will try it, but you are probably right about the server getting shutdown and the process somehow keeping alive.

The problem is recurrent, It happens from time to time for quite a while now. If I properly recall, the first time I got this problem was about a year ago.

One thing that I have noticed is that when the Java process starts not getting terminated, if I reboot the machine everything gets back to normal and it takes a few days or even a couple of weeks before the problem recur.

Before posting here, I've searched Google regarding the issue. Even though I've not found any thing related to Gradle, it seems that the issue is or was a recurring problem for Eclipse users developing for Appengine. Could that be somehow related?

Here is one of the links that I found: https://code.google.com/p/appengine-maven-plugin/issues/detail?id=11

Cheers.

— Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/gradle-appengine-plugin/issues/223#issuecomment-172112283 .

loosebazooka commented 8 years ago

I believe that maven problem is something else, if anything it's probably something specific to gradle and our implementation.

samcarecho commented 8 years ago

Folks, looks like my computer was exorcised. lol

Some some reason the problem is no longer reoccurring. It's probably the result of an update.