From jlahoda at openjdk.org Thu Aug 15 16:11:59 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 15 Aug 2024 16:11:59 GMT Subject: RFR: 8338281: jshell does not run shutdown hooks Message-ID: JShell normally runs user's snippets in a separate VM. And JShell is shutting down, it will send a CLOSE command to the remote agent, and then destroy the remote process. But, the remote process, after receiving the CLOSE command will not finish on its own, run until it is destroyed by `Process.destroy`. And `Process.destroy` may or may not run any shutdown hooks installed, which is the main point of this bug. This patch does the following: - the remote agent now exits when receiving the CLOSE event (the command loop is stopped, and then the `main` method finishes) - the JShell's close will wait for a moment for the remote process to finish ------------- Commit messages: - Fixing synchronization. - Introducing a constant for the shutdown. - Fixing the test on Windows. - Fixing tests. - 8338281: jshell does not run shutdown hooks Changes: https://git.openjdk.org/jdk/pull/20599/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20599&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8338281 Stats: 74 lines in 3 files changed: 72 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/20599.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20599/head:pull/20599 PR: https://git.openjdk.org/jdk/pull/20599 From prappo at openjdk.org Tue Aug 20 09:10:56 2024 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 20 Aug 2024 09:10:56 GMT Subject: RFR: 8301991: Convert l10n properties resource bundles to UTF-8 native [v2] In-Reply-To: References: Message-ID: On Wed, 13 Sep 2023 17:38:28 GMT, Justin Lu wrote: >> JDK .properties files still use ISO-8859-1 encoding with escape sequences. It would improve readability to see the native characters instead of escape sequences (especially for the L10n process). The majority of files changed are localized resource files. >> >> This change converts the Unicode escape sequences in the JDK .properties files (both in src and test) to UTF-8 native characters. Additionally, the build logic is adjusted to read the .properties files in UTF-8 while generating the ListResourceBundle files. >> >> The only escape sequence not converted was `\u0020` as this is used to denote intentional trailing white space. (E.g. `key=This is the value:\u0020`) >> >> The conversion was done using native2ascii with options `-reverse -encoding UTF-8`. >> >> If this PR is integrated, the IDE default encoding for .properties files need to be updated to UTF-8. (IntelliJ IDEA locks .properties files as ISO-8859-1 unless manually changed). > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > Replace InputStreamReader with BufferedReader src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties line 95: > 93: > 94: main.usage.summary=Uso: jar [OPTION...] [ [--release VERSION] [-C dir] files] ... > 95: main.usage.summary.try=Tente `jar --ajuda' para obter mais informa??es. I was looking for something unrelated in properties files, and found this. It is surprising to see an option name being localised; it must be a bug. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15694#discussion_r1722966688 From naoto at openjdk.org Tue Aug 20 15:30:58 2024 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 20 Aug 2024 15:30:58 GMT Subject: RFR: 8301991: Convert l10n properties resource bundles to UTF-8 native [v2] In-Reply-To: References: Message-ID: <9wZvcGjRkpfRm02paHISi86ynU0aYrW9WoinmyIb-RM=.9795a780-b857-4de3-bca6-075305fbd9f7@github.com> On Tue, 20 Aug 2024 09:07:54 GMT, Pavel Rappo wrote: >> Justin Lu has updated the pull request incrementally with one additional commit since the last revision: >> >> Replace InputStreamReader with BufferedReader > > src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties line 95: > >> 93: >> 94: main.usage.summary=Uso: jar [OPTION...] [ [--release VERSION] [-C dir] files] ... >> 95: main.usage.summary.try=Tente `jar --ajuda' para obter mais informa??es. > > I was looking for something unrelated in properties files, and found this. It is surprising to see an option name being localised; it must be a bug. Good catch, Pavel. It is indeed a bug. This type of overtranslation l10n bug happens all the time, and hard to catch. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15694#discussion_r1723520963 From asotona at openjdk.org Tue Aug 27 12:58:07 2024 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 27 Aug 2024 12:58:07 GMT Subject: RFR: 8338281: jshell does not run shutdown hooks In-Reply-To: References: Message-ID: On Thu, 15 Aug 2024 16:07:04 GMT, Jan Lahoda wrote: > JShell normally runs user's snippets in a separate VM. And JShell is shutting down, it will send a CLOSE command to the remote agent, and then destroy the remote process. But, the remote process, after receiving the CLOSE command will not finish on its own, run until it is destroyed by `Process.destroy`. > > And `Process.destroy` may or may not run any shutdown hooks installed, which is the main point of this bug. > > This patch does the following: > - the remote agent now exits when receiving the CLOSE event (the command loop is stopped, and then the `main` method finishes) > - the JShell's close will wait for a moment for the remote process to finish Looks good to me. ------------- Marked as reviewed by asotona (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20599#pullrequestreview-2263270723 From jlahoda at openjdk.org Thu Aug 29 10:10:21 2024 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 29 Aug 2024 10:10:21 GMT Subject: Integrated: 8338281: jshell does not run shutdown hooks In-Reply-To: References: Message-ID: On Thu, 15 Aug 2024 16:07:04 GMT, Jan Lahoda wrote: > JShell normally runs user's snippets in a separate VM. And JShell is shutting down, it will send a CLOSE command to the remote agent, and then destroy the remote process. But, the remote process, after receiving the CLOSE command will not finish on its own, run until it is destroyed by `Process.destroy`. > > And `Process.destroy` may or may not run any shutdown hooks installed, which is the main point of this bug. > > This patch does the following: > - the remote agent now exits when receiving the CLOSE event (the command loop is stopped, and then the `main` method finishes) > - the JShell's close will wait for a moment for the remote process to finish This pull request has now been integrated. Changeset: 8c8b5801 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/8c8b5801fd9d28a71edf3bd8d1fae857817e27de Stats: 74 lines in 3 files changed: 72 ins; 1 del; 1 mod 8338281: jshell does not run shutdown hooks Reviewed-by: asotona ------------- PR: https://git.openjdk.org/jdk/pull/20599