-
Bug
-
Resolution: Fixed
-
P3
-
17, 20
-
b26
-
linux
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8321469 | 17.0.11 | Volker Simonis | P3 | Resolved | Fixed | b01 |
In cases where the parent process terminates abnormally before `jspawnhelper` has read all the expected data from the pipe, `jspawnhelper` will block indefinitely on the reading end of the pipe. This is especially harmful if the parent process had open sockets, because in that case, the forked `jspawnhelper` process will inherit them and keep all the corresponding ports open effectively preventing other processes to bind to them. Notice that this is not an abstract scenario. We've observed this regularly in production with services which couldn't be restarted after a crash after migrating to JDK 17.
The fix of the issue is rather trivial. `jspawnhelper` has to close its writing end of the pipe which connects it with the parent Java process *before* starting to read from that pipe such that reads from the pipe can immediately return with EOF if the parent process terminates abnormally.
- backported by
-
JDK-8321469 jspawnhelper must close its writing side of a pipe before reading from it
- Resolved
- relates to
-
JDK-8311645 Memory leak in jspawnhelper spawnChild after JDK-8307990
- Resolved
-
JDK-8213192 (process) Change the Process launch mechanism default on Linux to be posix_spawn
- Resolved
-
JDK-8310265 (process) jspawnhelper should not use argv[0]
- Closed
-
JDK-8308350 Increase buffer size for jspawnhelper arguments
- Closed
- links to
-
Commit openjdk/jdk17u-dev/16f319a3
-
Commit openjdk/jdk/39f6d807
-
Review openjdk/jdk17u-dev/2013
-
Review openjdk/jdk/13956