On Fri, 3 Jul 2026 22:19:00 GMT, Coleen Phillimore <[email protected]> wrote:

>> Please review this change to allow XX configuration for specifying a 
>> different /tmp directory for the JVM to use.  In some container 
>> environments, /tmp and /proc/pid/root/tmp might not be usable and an 
>> alternate would be used.  This requires a release note and CSR.   Usage is:
>> 
>> java -XX:AltTempDir=/diags <app>
>> jps -J-XX:AltTempDir=/diags
>> jcmd -J-XX:AltTempDir=/diags <pid> <cmds>
>> 
>> Tested with a couple of tests and locally, and ran tier1-4.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Coleen Phillimore has updated the pull request incrementally with two 
> additional commits since the last revision:
> 
>  - Code review comments.
>  - Don't restrict AltTempDir at startup and defer to attach and hsperfdata 
> checking.  Check socket file length in attach Java code before retrying to 
> connect.  Fix the test.

src/hotspot/os/posix/attachListener_posix.cpp line 207:

> 205:                         os::get_temp_directory(), 
> os::current_process_id());
> 206:     return -1;
> 207:   }

Suggestion:

  else {
    log_warning(attach)("Failed to create temporary file for attach 
%s/.java_pid%d: file name is too long",
                        os::get_temp_directory(), os::current_process_id());
    return -1;
  }

src/hotspot/os/posix/attachListener_posix.cpp line 355:

> 353:   if (n >= (int)UNIX_PATH_MAX) {
> 354:     return;
> 355:   }

Does this not need a warning as well?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3526392442
PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3526396830

Reply via email to