GithubHelp home page GithubHelp logo

Quit gracefully when failed about ci.maven HOT 9 CLOSED

hantsy avatar hantsy commented on August 11, 2024
Quit gracefully when failed

from ci.maven.

Comments (9)

cherylking avatar cherylking commented on August 11, 2024

Before I dive too deep on this one, I want to make sure you are using the Maven plugin and not our Gradle plugin, since you used the word tasks. Please respond with which plugin you are using and what version. Thank you.

from ci.maven.

hantsy avatar hantsy commented on August 11, 2024

Yes, I am using the maven plugin, if there is an error caused the task failed, it should clean up the background JVM instance created by OpenLiberty maven plugin.

from ci.maven.

hantsy avatar hantsy commented on August 11, 2024

For example, I encountered this issue when deploying app via mvn liberty:run, OpenLiberty/open-liberty#25363

It will fail my deployment, although I tried to send a CTRL+C, the open liberty JVM instance is till running.

If I do not stop them in Windows Task Manager manually, I will encountered some resource lock error when running the command again.

from ci.maven.

cherylking avatar cherylking commented on August 11, 2024

Hi again, what version of the Liberty Maven Plugin are you using please.

from ci.maven.

hantsy avatar hantsy commented on August 11, 2024

3.7.1 at that moment, I will try again later.

from ci.maven.

cherylking avatar cherylking commented on August 11, 2024

@hantsy Looks like you will need to set the embedded parameter to true if you want Control-C to stop the server. See this documentation.

from ci.maven.

cherylking avatar cherylking commented on August 11, 2024

Also wanted to mention that we do have a ShutdownHook implemented in the Ant ServerTask, but it seems to not get reliably invoked on Windows in particular. I am not able to recreate this problem on my Mac.

from ci.maven.

scottkurz avatar scottkurz commented on August 11, 2024

Yes, you should be able to do a Ctrl+C even after a normal mvn liberty:run to stop both Maven and the server JVMs.

But it's a "best-effort" kind of thing, and if it doesn't end up working it could very well be a low-level, OS-level reason that's hard to debug from our build tooling. For example, on Windows, I know I can reliably recreate an issue like this by simply closing the terminal window/program used to launch mvn from. If I do this, the ShutdownHook will not have a chance to run and I'll experience this kind of issue, though in my experience this doesn't seem to be an issue on Mac or Linux. On the other hand, if I do a Ctrl+C from a normal session after mvn liberty:run it works fine.

Note that "dev mode", i.e. mvn liberty:dev, has a similar ShutdownHook registered, and a similar story: "works mostly except for sometimes on Windows".

This might be an opportunity to note that, when possible, we've tried to add additional cleanup in our Liberty Tools IDE plugins. E.g. in Liberty Tools Eclipse we have an extra cleanup watcher. You might be interested to take a look at them (or the Liberty Tools IntelliJ, VSCode extensions), if you haven't yet.

from ci.maven.

cherylking avatar cherylking commented on August 11, 2024

@hantsy I am going to close this issue since there are no additional code changes that we are aware of that should be made. We have the correct shutdown hooks in place. Unfortunately, we are at the mercy of the OS and the Java implementation.

from ci.maven.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.