Skip to content

8386334: JdepsTask keeps --system files open#31498

Open
dbalek wants to merge 5 commits into
openjdk:masterfrom
dbalek:dbalek/8386334
Open

8386334: JdepsTask keeps --system files open#31498
dbalek wants to merge 5 commits into
openjdk:masterfrom
dbalek:dbalek/8386334

Conversation

@dbalek

@dbalek dbalek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

When used with the --system option to target a different modular JDK image, JdepsTask keeps both lib/jrt-fs.jar and lib/modules open after it completes. This is the jdeps counterpart of the issue previously seen with JavacTask in JDK-8357249.

For an alternate java.home, JdepsConfiguration.SystemModuleFinder creates a new jrt:/ file system using the target image. That file system and the URL class loader used by its provider, are not closed when the jdeps configuration is closed.

The proposal is to modify JdepsConfiguration.close() to also close the associated SystemModuleFinder, ensuring that these resources are released after the task finishes.



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8386334: JdepsTask keeps --system files open (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31498/head:pull/31498
$ git checkout pull/31498

Update a local copy of the PR:
$ git checkout pull/31498
$ git pull https://git.openjdk.org/jdk.git pull/31498/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31498

View PR using the GUI difftool:
$ git pr show -t 31498

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31498.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 12, 2026

Copy link
Copy Markdown

👋 Welcome back dbalek! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jun 12, 2026

Copy link
Copy Markdown

@dbalek This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8386334: JdepsTask keeps --system files open

Reviewed-by: vromero

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 24 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@vicente-romero-oracle) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk

openjdk Bot commented Jun 12, 2026

Copy link
Copy Markdown

@dbalek The following labels will be automatically applied to this pull request:

  • compiler
  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 12, 2026
@mlbridge

mlbridge Bot commented Jun 12, 2026

Copy link
Copy Markdown

Webrevs

archive.close();
for (Module module : nameToModule.values())
module.close();
system.close();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally each close should be wrapped in try-catch but I guess it's okay to leave as is

Comment thread src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java Outdated
Comment thread src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java Outdated

@vicente-romero-oracle vicente-romero-oracle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler [email protected] core-libs [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

4 participants