> On 10 Jul 2024, at 16:37, Jaroslav Bachorik <j.bacho...@gmail.com> wrote: > > 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. > > Forn this PoV the proposal to allow optionally ignoring non-existing Java > agent sounds as a very pragmatic solution,
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. 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. — Ron