<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 10/07/2024 16:37, Jaroslav Bachorik wrote:<br>
<blockquote type="cite" cite="mid:CAJBAviu5S-Kes9yWt1ZwHNDJTPf94NpwPHoQE9rV+M765BC-_A@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">:<br>
</div>
<div class="gmail_quote">
<div><br>
</div>
<div>This may not always be possible. Some systems have rather
complex and inlexible launchers - for example Apache Spark
with its clusters, drivers and executors and automatic
distribution of resources. For that system, if one needs to
add an on-startup Java agent via `-javaagent` option the
only way is to modify the setup which will add `-javaagent`
to all components, pointing to a location where the resource
distribution service should be putting the agent jar.
However, mistakes happen and the jar may not be there. But
because usually the agent is providing tracing or metrics
collection, which are all optional, it is not feasible to
hard-crash the Java process because of not being able to
load the Java agent.</div>
<div><br>
</div>
<div>Forn this PoV the proposal to allow optionally ignoring
non-existing Java agent sounds as a very pragmatic solution,</div>
<br>
</div>
</div>
</blockquote>
<br>
The issue of injecting CLI options to start tool agents was explored
back in JSR 163, that is the reason for environment variables such
as JAVA_TOOL_OPTIONS. Broader support was added in JDK 9 with
JDK_JAVA_OPTIONS, @argfile support, and support for GNU style
options. So the JDK has several features to augment the command line
or options.<br>
<br>
Has anyone tried to work with the Apache Spark (or other projects)
to make use of any of this support so that additional CLI options
are conditionally used?<br>
<br>
-Alan<br>
<br>
</body>
</html>