Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-31 Thread Jaikiran Pai
On Thu, 1 Feb 2024 05:42:07 GMT, David Holmes wrote: >> Hello David, I had actually first put it in that line you noted, but that >> then lead to a compilation error: >> >> >> In file included from >> /jdk/src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c:33: >> /jdk/src/jdk.jdwp.agent/share/n

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-31 Thread David Holmes
On Wed, 31 Jan 2024 07:52:18 GMT, Jaikiran Pai wrote: >> src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c line 35: >> >>> 33: #include "sys.h" >>> 34: #include "util.h" >>> 35: #include "error_messages.h" >> >> Nit: to maintain include sort order this should have gone where >> `log_messages.h`

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v7]

2024-01-31 Thread David Holmes
On Wed, 31 Jan 2024 08:01:15 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v7]

2024-01-31 Thread Gerard Ziemski
On Wed, 31 Jan 2024 08:01:15 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v7]

2024-01-31 Thread Jaikiran Pai
On Wed, 31 Jan 2024 08:01:15 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v7]

2024-01-31 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iterates over an extremely large > number of file descripto

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-31 Thread Jaikiran Pai
On Wed, 31 Jan 2024 06:28:05 GMT, David Holmes wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Chris' review suggestion - replace LOG_MISC with ERROR_MESSAGE > > src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c lin

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-30 Thread Jaikiran Pai
On Wed, 31 Jan 2024 06:27:33 GMT, David Holmes wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Chris' review suggestion - replace LOG_MISC with ERROR_MESSAGE > > src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c lin

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-30 Thread David Holmes
On Wed, 31 Jan 2024 01:46:57 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-30 Thread Jaikiran Pai
On Wed, 31 Jan 2024 01:46:57 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-30 Thread Chris Plummer
On Wed, 31 Jan 2024 01:46:57 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v5]

2024-01-30 Thread Jaikiran Pai
On Tue, 30 Jan 2024 19:41:48 GMT, Chris Plummer wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> assert that we don't pass values higher than INT_MAX to close() > > src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c l

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v6]

2024-01-30 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iterates over an extremely large > number of file descripto

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v5]

2024-01-30 Thread Chris Plummer
On Tue, 30 Jan 2024 16:17:58 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v5]

2024-01-30 Thread Gerard Ziemski
On Tue, 30 Jan 2024 16:17:58 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-30 Thread Gerard Ziemski
On Tue, 30 Jan 2024 16:15:17 GMT, Jaikiran Pai wrote: >>> If we are going to check close for errors then we will have to know for >>> certain we are only trying to close open fd's, and we will have to deal >>> with EINTR. I would think this is a "best effort" to close open FD's and >>> not som

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v5]

2024-01-30 Thread Gerard Ziemski
On Tue, 30 Jan 2024 16:17:58 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-30 Thread Jaikiran Pai
On Tue, 30 Jan 2024 06:52:49 GMT, David Holmes wrote: >> src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c line 129: >> >>> 127: /* Find max allowed file descriptors for a process >>> 128: * and assume all were opened for the parent process and >>> 129: * copied over to

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-30 Thread Jaikiran Pai
On Mon, 29 Jan 2024 17:45:34 GMT, Gerard Ziemski wrote: >> Hello Gerard, my understanding is that the limit value configured may exceed >> the int range. I wanted to avoid the overflow by casting it to int in such >> cases. I had noticed close() takes an int, but I couldn't think of any other

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-30 Thread Jaikiran Pai
On Tue, 30 Jan 2024 07:14:45 GMT, Alan Bateman wrote: >> If we are going to check close for errors then we will have to know for >> certain we are only trying to close open fd's, and we will have to deal with >> EINTR. I would think this is a "best effort" to close open FD's and not >> somethi

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v5]

2024-01-30 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iterates over an extremely large > number of file descripto

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread Alan Bateman
On Tue, 30 Jan 2024 06:47:38 GMT, David Holmes wrote: > If we are going to check close for errors then we will have to know for > certain we are only trying to close open fd's, and we will have to deal with > EINTR. I would think this is a "best effort" to close open FD's and not > something w

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread David Holmes
On Mon, 29 Jan 2024 10:00:37 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread David Holmes
On Mon, 29 Jan 2024 19:25:35 GMT, Chris Plummer wrote: >> Jaikiran Pai has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - add a log message to help debuggability >> - improve code comments >> - David's review - use standard isdigit in

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread David Holmes
On Mon, 29 Jan 2024 19:21:05 GMT, Chris Plummer wrote: >> src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c line 108: >> >>> 106: if (isdigit(dirp->d_name[0]) && >>> 107: (fd = strtol(dirp->d_name, NULL, 10)) >= from_fd) { >>> 108: (void)close(fd); >> >> I'd reall

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread Chris Plummer
On Mon, 29 Jan 2024 10:00:37 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread Chris Plummer
On Mon, 29 Jan 2024 17:51:36 GMT, Gerard Ziemski wrote: >> Jaikiran Pai has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - add a log message to help debuggability >> - improve code comments >> - David's review - use standard isdigit i

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-29 Thread Gerard Ziemski
On Sat, 27 Jan 2024 01:18:09 GMT, Jaikiran Pai wrote: >> src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c line 129: >> >>> 127: * and assume all were opened for the parent process and >>> 128: * copied over to this child process. we close them all */ >>> 129: const rlim

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread Gerard Ziemski
On Mon, 29 Jan 2024 10:00:37 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v3]

2024-01-29 Thread Jaikiran Pai
On Mon, 29 Jan 2024 04:36:35 GMT, David Holmes wrote: >> Jaikiran Pai has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - log a warning message if we fallback to slower logic of closing file >> descriptors >> - ignore return values, cast

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v3]

2024-01-29 Thread Jaikiran Pai
On Sat, 27 Jan 2024 13:09:45 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v4]

2024-01-29 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iterates over an extremely large > number of file descripto

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v3]

2024-01-28 Thread David Holmes
On Sat, 27 Jan 2024 13:09:45 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-27 Thread Jaikiran Pai
On Sat, 27 Jan 2024 13:06:59 GMT, Jaikiran Pai wrote: >> src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c line 112: >> >>> 110: } >>> 111: >>> 112: closedir(dp); >> >> Should this be: >> >> `(void)close(fd);` >> >> and >> >> `(void)closedir(dp);` >> >> to show that we're ignoring

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-27 Thread Jaikiran Pai
On Fri, 26 Jan 2024 17:33:39 GMT, Gerard Ziemski wrote: > Have you considered using `fcntl(d, F_SETFD, 1)` instead of the fancy > `closeDescriptors()`? > > I haven't tested it myself, but per the `man close` page: > > ``` > Most of the descriptors can be rearranged with dup2(2) or deleted with

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v3]

2024-01-27 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iterates over an extremely large > number of file descripto

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-26 Thread Jaikiran Pai
On Fri, 26 Jan 2024 17:29:10 GMT, Gerard Ziemski wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> use the right include for rlim_t - > > src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c line 129: > >> 127:

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-26 Thread Gerard Ziemski
On Fri, 26 Jan 2024 15:57:57 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-26 Thread Gerard Ziemski
On Fri, 26 Jan 2024 15:57:57 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-26 Thread Gerard Ziemski
On Fri, 26 Jan 2024 15:57:57 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-26 Thread Gerard Ziemski
On Fri, 26 Jan 2024 15:57:57 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to address >> https://bugs.openjdk.org/browse/JDK-8324668? >> >> This change proposes to fix the issue in jdwp where when launching a child >> process (for the `launch=` option), it

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling [v2]

2024-01-26 Thread Jaikiran Pai
> Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iterates over an extremely large > number of file descripto

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling

2024-01-26 Thread Jaikiran Pai
On Fri, 26 Jan 2024 14:52:49 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iter

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling

2024-01-26 Thread Jaikiran Pai
On Fri, 26 Jan 2024 14:52:49 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > This change proposes to fix the issue in jdwp where when launching a child > process (for the `launch=` option), it iter

Re: RFR: 8324668: JDWP process management needs more efficient file descriptor handling

2024-01-26 Thread Roger Riggs
On Fri, 26 Jan 2024 14:52:49 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which proposes to address > https://bugs.openjdk.org/browse/JDK-8324668? > > The JVM can be launched with the `jdwp` agent, like > `-agentlib:jdwp=transport=xxx,server=y`. Among other options to th

RFR: 8324668: JDWP process management needs more efficient file descriptor handling

2024-01-26 Thread Jaikiran Pai
Can I please get a review of this change which proposes to address https://bugs.openjdk.org/browse/JDK-8324668? The JVM can be launched with the `jdwp` agent, like `-agentlib:jdwp=transport=xxx,server=y`. Among other options to the `jdwp` agentlib, one option is the `launch` option, which is of