[
https://jira.codehaus.org/browse/MEXEC-109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=298329#comment-298329
]
Henryk Konsek commented on MEXEC-109:
-------------------------------------
Actually I think that JVM shutdown hook should be activated by default. If we
remove it, we will introduce a possible resource leak.
Imagine scenario when somebody started process in phase A and wanted to kill
the process in phase B. If build fails after A and before B, the forked process
will be still alive after the build. This will very likely to happen if we do
not introduce JVM shutdown hook but rely on developers to kill the process in
the arbitrary phase.
I also think that we should not allow forked process to live longer than the
Maven build itself. A forked process is supposed to be used in the build
process - it should not be available after the Maven ends.
I would propose the following approach:
* start with fork option and JVM shutdown hook (secure default)
* in the next commit introduce a) optional phases hooks and b) option to turn
off the JVM shutdown hook
However I consider starting with the JVM shutdown hook (as I proposed) is the
most secure approach. Phases hooks and option to turn off the JVM hook will be
nice additional features for users who know how to (and want to) handle the
process by custom phase hooks.
So what do you think about sticking to the JVM hook at this moment? I could add
phase hooks and JVM shutdown hook disable option in the next commit, but I
really believe that starting with JVM shutdown hook is the most sensible
default.
> Fork patch
> ----------
>
> Key: MEXEC-109
> URL: https://jira.codehaus.org/browse/MEXEC-109
> Project: Maven 2.x Exec Plugin
> Issue Type: New Feature
> Components: exec
> Affects Versions: 1.3
> Reporter: Henryk Konsek
> Attachments: maven-exec-fork.patch, maven-exec-fork.reverse-patch
>
>
> Hi guys,
> The topic of fork exec (aka background process) has been raised few times
> here however there is still no such functionality in the trunk. Therefore I
> created patch (plus tests) for the trunk that provides the basic version of
> that feature.
> My proposal is to add <fork> option to the configuration:
> <configuration>
> <fork>true</fork>
> <executable>/opt/bin/myLongRunningProcess</executable>
> </configuration>
> The background process is automatically killed when the Maven JVM exists. In
> the future we could add an additional shutdown hooks (on given Maven phase
> for example).
> This patch saved my life in few projects with heavy exec-related integration
> :) . Could somebody take a look at it and (hopefully) add it to the trunk?
> Running the process in the background is essential for many people and we
> just need in the trunk.
> Kind regards.
> PS I'm attaching both regular and reverse patch.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email