Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon support: option to leave forked-process running beyond build, non-stopAfter #4

Open
javabrett opened this issue Oct 27, 2017 · 1 comment

Comments

@javabrett
Copy link

Not sure this is a particularly Gradle-ish or build-sane thing to do, but I was looking in Gradle and in some other plugins for the ability to have Gradle launch a daemon task - a long-running forked child-process that outlives the current build (even the JVM that forks it if not running the Gradle Daemon).

I guess it's a choice between having a Gradle build that it expected to block-forever (could be backgrounded) waiting for an exit condition so it can clean-up the daemon, versus a build that has known side-effects (leaves processed running).

If backward compatibility were not a concern, ideally a stopAfter=null could mean this, but that currently represents stopOnBuildCompletion.

@Haratsu
Copy link

Haratsu commented Jul 18, 2018

Could be achieved by adding a property like killOnExit (Default: true for downward compatibility) to com.github.psxpaul.task.AbstractExecFork and applying it to:

fun stop() {
        if (process != null && process!!.isAlive && killOnExit)
            process!!.destroyForcibly().waitFor(15, TimeUnit.SECONDS)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants