RFR: 8353439: Shell grouping of -XX:OnError= commands is surprising [v3]

Kevin Walls kevinw at openjdk.org
Tue Apr 8 12:11:18 UTC 2025


On Tue, 8 Apr 2025 09:54:21 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> Hmm.
> 
> May there not be customers that specify a verbatim "spelled out" shell script as input for OnError? This is a behavior change.
> 
> And if not (if the commands issued with OnError, separated by ;, are in turn real commands, programs or scripts): Those, before, were forked off as separate grandchilds to the same parent (the direct child), right? Whereas now we have a single parent for each grandchild process. But here, especially if OnError had been called as reaction to an OOM condition by a gigantic JVM, reusing that in-between shell may be preferable. Forking off a large process can be expensive.
> 
> (Obviously, its all undocumented, which is bad in itself).
> 
> All of these are questions - I may not know the full story.

Hi Thomas!
Not sure I understand the first line about behaviour change.
The ; separator was causing new separate shells used sequentially, but distinct OnError= arguments were not (yes, IF somebody has discovered that this works).  So with the change, everything gets a new shell fork/exec'd.  This should be more consistent, less surprising.
I can't pretend the previous behaviour was to save memory!  The posix_spawn usage hopefully means such big processes are more efficient.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24354#issuecomment-2786223663


More information about the hotspot-dev mailing list