Spring Boot BackgroundPreinitializer
Sebastien Deleuze
sebastien.deleuze at broadcom.com
Tue Oct 8 08:28:17 UTC 2024
Ioi, thanks for updating https://bugs.openjdk.org/browse/JDK-8338476, looks
great.
John, thanks for your feedback, I indeed see how it could go wrong if you
introduce some properties or APIs that allow to differentiate training from
deployment runs without any control. If I take a step back, our main need
is to get a boolean status that indicated if an AOT cache is being recorded
or used, without needing to differentiate training from deployment runs
(the use case here is to disable Spring Boot BackgroundPreinitializer when
AOT cache is enabled regardless of the kind of run).
A potential future additional need would be to provide the capability to
run additional code only during the training run, maybe via a lambda
parameter (the use case here is to preload some additional classes or to
perform additional processing to warm up the JVM when the
-Dspring.context.exit=onRefresh flag documented in
https://docs.spring.io/spring-framework/reference/integration/cds.html is
used). But I am less confident on that use case that probably deserves more
concrete use cases and experimentation.
So I think for now our ask is only about this undifferentiated boolean flag
(property or API) that would be true if
"-XX:AOTMode=record/autocreate/on/auto" is set.
On Tue, Oct 8, 2024 at 6:46 AM <ioi.lam at oracle.com> wrote:
>
> On 10/7/24 3:29 PM, John Rose wrote:
> > On 4 Oct 2024, at 3:29, Sebastien Deleuze wrote:
> >
> >
> >> Side note: we really hope that a "-XX:CacheDataStore=app.cds" successor
> >> will be introduced because it really helps to not have to change the
> java
> >> command line between training and deployment runs for some deployment
> >> scenarios.
> > We should have a tracking RFE for this; I think Ioi
> > might have one.
> >
> > — John
>
>
> I updated https://bugs.openjdk.org/browse/JDK-8338476 to include two
> variants
> of creating Leyden-enabled AOT caches:
>
> [1] Identical replacement of the -XX:CacheDataStore flag (aka "one step
> workflow",
> where the AOT cache is created with a single "java" command).
>
> java -XX:CacheDataStore=app.cds -cp app.jar App
> =>
> java -XX:AOTMode=autocreate -XX:AOTCache=app.aot -cp app.jar App
>
> - If app.aot exists, it will be used to run the application
> - Otherwise, app.aot will be created when the application exits
>
> [2] "Two step work flow" (as proposed in JEP 483), where two "java"
> commands are
> executed: one to perform the training run, the other to perform the
> assembly phase.
>
> java -XX:AOTMode=record -XX:AOTConfiguration=foo.aotconfig -cp
> app.jar App
> java -XX:AOTMode=create -XX:AOTConfiguration=foo.aotconfig
> -XX:AOTCache=foo.aot -cp app.jar
>
>
--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/leyden-dev/attachments/20241008/6657e2b8/attachment.htm>
More information about the leyden-dev
mailing list