On Tue, 15 Apr 2025 23:30:35 GMT, Alex Menkov <amen...@openjdk.org> wrote:
> The change is a preparation step to enable attach streaming output by default. > The fix updates a number of tests which fail with timeout in tier1..tier7 > when attach streaming output is enabled. > Details in the first comment. > Testing: tier1..7 with enabled attach streaming output The tests use the same scenario: test runs a tool (jcmd/jstack/jmap) to attach to the main test process and redirects the tool output for analysis. We have 2 buffers here: 1. attach channel (socket or pipe depending on platform) - attach operation handler writes, the tool reads. 2. tool redirection buffer - the tool writes, test reads. When attach operation is executes at safepoint, attach streaming output is enabled and the tool output is lengthy we can get both buffers full and the test hung: - attach handler blocks on write operation (tool need to read from the socket/pipe); - the tool reads data from attach channel and blocks writing the data to its stdout (need to read from redirected stream); - test redirector reader cannot read because the VM is at safepoint executing attach operation. To avoid the deadlocks the test are updated to disable attach streaming output (attach operation output is buffered and is sent after the operation is completed). ------------- PR Comment: https://git.openjdk.org/jdk/pull/24672#issuecomment-2807765324