On Fri, 27 Feb 2026 18:29:43 GMT, Volker Simonis <[email protected]> wrote:

> Hi Thomas,
> 
> Thanks a lot for finding this issue, describing it in all details and 
> creating regression tests for it.
> 
> From a first glance the changes look OK but I'll have to take a closer look 
> next week.
> 
> I am just a little concerned about the ever increasing code complexity in 
> this area. Have you thought about using Unix domain sockets with 
> `socketpair()` instead of pipes for the parent/child communication? That 
> might be simpler and more portable, although I haven't really tried it out 
> yet.

Hi Volker,

Yes, I thought about it, but I don't think it would improve matters much, and I 
wanted to keep the patch small. Also, most complexity just shifted. 
jspawnhelper is much less complex than before. And passing file descriptors via 
dup2 file action is arguably the canonical solution for these problems.

Complexity reduction will come. We will get rid of the VFORK mode very shortly, 
and maybe of the fork mode too, since it makes no sense to continue supporting 
it if posix_spawn works. Also, I plan to investigate the use of file actions 
more fully - most of what we do in jspawnhelper can be done via file actions in 
modern libc's (e.g. closing descriptors), and maybe at some point will get rid 
of the double exec and the jspawnhelper completely.

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

PR Comment: https://git.openjdk.org/jdk/pull/29939#issuecomment-3976534926

Reply via email to