<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri 12. 7. 2024 at 21:06, Ron Pressler <<a href="mailto:ron.pressler@oracle.com">ron.pressler@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On 10 Jul 2024, at 16:37, Jaroslav Bachorik <<a href="mailto:j.bachorik@gmail.com" target="_blank">j.bachorik@gmail.com</a>> wrote:<br>
> <br>
> 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.<br>
> <br>
> Forn this PoV the proposal to allow optionally ignoring non-existing Java agent sounds as a very pragmatic solution,<br>
<br>
A pragmatic solution of one problem is often — as in this case — the cause of other problems. A Java application may happen to run, by chance, with some classes or an agent missing, or it may not, which may manifest in a strange way.<br>
<br>
In order to better judge the pros and cons, can you please explain in as much detail as could be relevant, the difficulties involved in having different runtime scripts and/or a conditional in the script? This would be at least as pragmatic a solution, so to compare the two we need to understand why a script can be so difficult to write or change as to necessitate a change to the JDK. Going from “my startup script is not very flexible” to “so let’s change the JDK” is a big jump that would require a big justification.</blockquote><div dir="auto"><br></div><div dir="auto">I have unwittingly became the advocate for this change although I really don’t care at this moment.  I just thought to bring up my painful experience when I had to deal with Yarn (clustering solution) and Apache Spark. </div><div dir="auto">You can read more about that at <div dir="auto"><a href="https://spark.apache.org/docs/latest/running-on-yarn.html#spark-properties">https://spark.apache.org/docs/latest/running-on-yarn.html#spark-properties</a> - I am not going to transcribe all of that here. </div><div dir="auto"><br></div><div dir="auto">The bottom line is that the clustering solution allows specifying JVM options and extra resources that will be distributed to all nodes. Hence, if you want to add an agent, you need to add the jvn options to point to the location where the agent jar (resource) will be placed.  As you can expect, things can break and you end up killing your Spark pipeline instead of running without observably 🤷‍♂️</div><div dir="auto"><br></div><div dir="auto">However, I don’t understand the argument that running without agent can lead to subtle errors. Agents were always meant to be optional - the core application functionality should not really be dependent on the agent availability. But, obviously, I was wrong all this time. </div><div dir="auto"><br></div><div dir="auto">-JB-</div></div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" dir="auto"><br>
<br>
— Ron</blockquote></div></div>