Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[hudson-dev] stop maven build step leaves running processes

Hi,

During our maven build we use a custom maven plugin which spawns external process, which executes UI tests for an application. Our maven plugin uses runtime shutdown hooks to gracefully terminate test runner and application-under-test.

Today I found that when I terminate a build, shutdown hooks are not executed, moreover all processes launched from maven plugin continue running.

What's interesting, if I use shell build step, which just invokes maven, everything works correctly -- shutdown hooks work and all processes exit.

I've prepared a tiny demo -- https://github.com/komaz/test-cancel.
- run.sh just prints a message to stdout and a file every second during one minute.
- pom.xml uses exec-maven-plugin to launch this shell.

Here I have two jobs:
- https://hudson.eclipse.org/rcptt/view/test-cancel/job/direct-maven-invoke/ -- runs maven via Maven 3 build step. When I start build and then stop it, I can go to workspace and see that external process is not stopped (file is being appended -- https://hudson.eclipse.org/rcptt/view/test-cancel/job/direct-maven-invoke/ws/out.txt).
- https://hudson.eclipse.org/rcptt/view/test-cancel/job/shell-maven-invoke/ -- runs maven via shell build step. When I start and stop it, child process is killed correctly.

Is this a known issue? Any workaround available?

Thanks,
Ivan


Back to the top