Skip to content

Commit bb7c97b

Browse files
committedApr 15, 2022
8284874: Add comment to ProcessHandle/OnExitTest to describe zombie problem
Reviewed-by: rriggs
1 parent 1e22c70 commit bb7c97b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
 

‎test/jdk/java/lang/ProcessHandle/OnExitTest.java

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -95,6 +95,24 @@ public static void test1() {
9595
*/
9696
@Test
9797
public static void test2() {
98+
99+
// Please note (JDK-8284282):
100+
//
101+
// On Unix, this test relies on the ability of the system to adopt orphaned processes and
102+
// reap them in a timely fashion. In other words, the ability to prevent orphans from becoming
103+
// zombies.
104+
//
105+
// Therefore, on misconfigured or broken systems, this test may fail. These failures will manifest
106+
// as timeouts. The failures depend on timing: they may not happen at all, be intermittent or
107+
// constant.
108+
//
109+
// That will rarely be a problem on bare-metal systems but may be more common when running in
110+
// Docker. Misconfigured Docker instances may run with an initial process unable to reap. One
111+
// infamous example would be running jtreg tests inside a Docker via Jenkins CI.
112+
//
113+
// This is quite difficult - and inefficient - to fix inside this test, and rather easy to
114+
// avoid. For a detailed analysis, as well as proposed workarounds, please see JDK-8284282.
115+
//
98116
ProcessHandle procHandle = null;
99117
try {
100118
ConcurrentHashMap<ProcessHandle, ProcessHandle> processes = new ConcurrentHashMap<>();

3 commit comments

Comments
 (3)

openjdk-notifier[bot] commented on Apr 15, 2022

@openjdk-notifier[bot]

GoeLin commented on Sep 23, 2024

@GoeLin
Member

/backport jdk17u-dev

openjdk[bot] commented on Sep 23, 2024

@openjdk[bot]

@GoeLin the backport was successfully created on the branch backport-GoeLin-bb7c97bd-master in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit bb7c97bd from the openjdk/jdk repository.

The commit being backported was authored by Thomas Stuefe on 15 Apr 2022 and was reviewed by Roger Riggs.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-bb7c97bd-master:backport-GoeLin-bb7c97bd-master
$ git checkout backport-GoeLin-bb7c97bd-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-bb7c97bd-master
Please sign in to comment.