GoogleCloudPlatform / app-gradle-plugin

The library has moved to https://github.com/GoogleCloudPlatform/appengine-plugins/tree/main/app-gradle-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stopping appengineRun doesn't automatically run appengineStop anymore

ndtreviv opened this issue · comments

I'm running tasks for this plugin from IntelliJ.

In older versions, I used to be able to run appengineRun to run the devserver; then, when I stopped that task it would automatically run appengineStop. This version doesn't seem to do that anymore?

Is there I way I can make it do that?

commented

I'm not sure I understand your workflow?

You would run appengineRun from the gradle menu in intellij? And then click the red ⬜ to stop it from within intellij and that would trigger the appengineStop task from gradle?

commented

I'm afraid we can't really control intellij workflows from the appengine gradle plugin. However the cloud-code plugin has some facilities for managing your appengine workflows in intellij. Perhaps that could help you?

The issue is that if you stop an appengineRun task, it stays bound to the port. So you can't just run it again, because it didn't shut down properly. Previously, appengineStop was automatically run as part of stopping appengineRun.
Now that doesn't happen, can appengineRun shutdown actually shut it down?

I think I'm having the same or similar issue.

A little context... When I run ./gradlew appengineStart it starts the server and detaches. To stop it I run appengineStop.

When I run appengineRun, it stays attached and tails logs. The expected behavior is that killing the running process (ctrl+c in the terminal) will stop the running server. (This is pretty standard for most/all servers that are started this way) However, it doesn't actually stop it. I have to then run appengineStop to stop it or I get a port conflict if I do appengineRun again.

commented

Ctrl+c usually works for me. Are you running on a windows machine? Maybe the code needs a chance to shutdown? Does waiting a few seconds help?

The issue is we're not able to reproduce this locally well.

Closing due to cleanup. Please reopen if still relevant

@diegomarquezp Can you reopen this issue?

I upgraded from Gradle 4.6 to Gradle 8.2 and from 2.3.0 to the latest 2.4.5 of app-gradle-plugin.

Before upgrading, it worked as @aaronvargas said: running appengineRun kept the instance attatched and logging, Ctrl+C killed it.

After upgrading, on Windows' cmd, Ctrl+C does nothing to the instance, it now stays in background, which is okay-ish. If you run appengineStop, it works fine.

The issue happens when running appengineRun again (as if by mistake, as if you forgot to stop it first), it triggers war which makes the background running instance stop working properly (failing to load classes and whatnot), which sometimes also makes appengineStop stop working, requiring killing it with task manager or kill command, which is the issue we're having.

I couldn't find appengineRun's daemon option some stackoverflow mentions, so I suppose it was removed. So my temporary fix right now is to throw when attempting to execute appengineRun if Gradle is running on a daemon, then running specifically this task with the Gradle CLI option to disable its daemon.

Hi,
Is there any fix for this issue?

Please reopen this issue, it isn't fixed yet