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

Disable the image build server by default #2598

Closed
christianwimmer opened this issue Jun 22, 2020 · 5 comments · Fixed by #2618
Closed

Disable the image build server by default #2598

christianwimmer opened this issue Jun 22, 2020 · 5 comments · Fixed by #2618

Comments

@christianwimmer
Copy link
Member

The native-image tool has a mode that leaves the Java HotSpot VM performing the image build alive after an image build. Subsequent image builds can reuse that VM, which is then already warmed up and therefore subsequent image builds are faster.

Currently, the build server is enabled by default, and can be disabled using the option --no-server. We propose to flip the default, so that enabling the server requires an opt-in using --experimental-build-server.

While the build server has its uses, it is unfortunately not production quality at this point. We encounter bugs regularly where static state, especially in the JDK, survives from one build to another, leading to strange and hard-to-debug build errors (or even worse, runtime errors of the generated image). For example, #2554 is such a bug that is currently open. Fixing all the issues in a principled manner requires a level of isolation of the JDK that the image generator currently cannot provide: ideally, each image would get its own non-initialized copy of the JDK.

Several frameworks that support Native Image (Spring, Quarkus, Micronaut) already disable the build server by default or encourage users to disable it.

Alternatives:

  • Leave the build server enabled by default, invest constantly in fixing occurring issues, but accepting that new issues cannot be avoided.
  • Remove the code for the image builder completely: At this point, this seems unnecessary.

If anyone has comments or a preference, please comment on this issue.

@eginez
Copy link
Contributor

eginez commented Jun 22, 2020

Sounds good to me

@chrisseaton
Copy link
Contributor

I recommend --no-server to everyone. The build server feels like a repeat of similar workarounds like Nailgun and Drip, and neither of these ever really worked great in practice.

@adinn
Copy link
Collaborator

adinn commented Jun 23, 2020

Disabled by default sounds better to me.

@ilopmar
Copy link

ilopmar commented Jun 23, 2020

Yes please. We use --no-server by default in Micronaut and it always looked to me that it should be the default without any flags. 👍 for this change.

@olpaw
Copy link
Member

olpaw commented Jun 23, 2020

I'm in favor for flipping the default and making the build server usecase experimental.
Warmup reuse cannot be done safely without the JVM providing proper isolation.

Mukamik added a commit to Mukamik/java-pubsub that referenced this issue Jun 13, 2022
Proposing this change since no-server is now [enabled by default](oracle/graal#2598), and I got a warning that this flag is being ignored during the build.
Mukamik added a commit to Mukamik/java-pubsub that referenced this issue Jun 14, 2022
Proposing this change since [no-server](oracle/graal#2598) is now enabled by default, and I got a warning that this flag is being ignored during the build.

For context, I got the warning when building on cloud shell with Graal 22.0.0.2-r17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants