Skip to content

Fork process with spring-boot:run by default #16945

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

Closed
snicoll opened this issue May 22, 2019 · 3 comments
Closed

Fork process with spring-boot:run by default #16945

snicoll opened this issue May 22, 2019 · 3 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented May 22, 2019

The maven plugin currently has some logic to fork the maven process if necessary (e.g. if the path to an agent is set or if devtools is on the classpath).

This can have surprising side effects. Even though, this is not recommended, specifying "raw" system properties on the command line are transmitted to the Spring Boot application when the process is not forked. Currently, adding devtools would break that as this isn't the case when the process is forked.

Gradle always fork the process so those are two good reasons to align and always fork the process by default as well.

We'll flip the default of the fork property so that users have an escape hatch while migrating.

@wilkinsona
Copy link
Member

The new optimizedLaunch setting that's proposed in #16222 will mean that a new JVM is forked by default. To avoid forking a new JVM, a user will have to set optimizedLaunch to false, thereby removing the JVM arguments that are used for the optimization.

@wilkinsona
Copy link
Member

On second thoughts, having reviewed #16941, I think we should tackle this the other way around. Once we've switched to forking the JVM by default, we can then add the launch optimization arguments when forking the JVM. If the user sets optimizedLaunch to false, the arguments will not be added. If the user disables forking, the JVM will not be forked and no optimisation will occur, irrespective of the configuration of optimizedLaunch. We could log a warning if optimizedLaunch has been explicitly set to true and forking has been disabled.

@snicoll snicoll self-assigned this May 23, 2019
@snicoll
Copy link
Member Author

snicoll commented May 23, 2019

We could log a warning if optimizedLaunch has been explicitly set to true and forking has been disabled.

@wilkinsona that's what we already do for other features (such as devtools) and that plan aligns nicely with what we have now (I think).

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

No branches or pull requests

2 participants