Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8300977: Retire java.io.ExpiringCache #12167

Closed
wants to merge 4 commits into from

Conversation

minborg
Copy link
Contributor

@minborg minborg commented Jan 24, 2023

This PR proposed to retire the class 'java.io.ExpiringCache'. The use of the class has been off by default since Java 16 but could be explicitly turned on by means of two System properties.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8301001 to be approved
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issues

  • JDK-8300977: Retire java.io.ExpiringCache
  • JDK-8301001: Retire the system properties sun.io.useCanonCaches and sun.io.useCanonPrefixCache (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12167

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 24, 2023

👋 Welcome back pminborg! 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
Copy link

openjdk bot commented Jan 24, 2023

@minborg The following label will be automatically applied to this pull request:

  • core-libs

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

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jan 24, 2023

private static boolean getBooleanProperty(String prop, boolean defaultVal) {
String value = System.getProperty(prop);
return (value != null) ? Boolean.parseBoolean(value) : defaultVal;
}

static {
useCanonCaches = getBooleanProperty("sun.io.useCanonCaches", false);
useCanonPrefixCache = useCanonCaches && getBooleanProperty("sun.io.useCanonPrefixCache", false);
infoPropIsIgnored("sun.io.useCanonCaches");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure we should warn. If we should, there might be a better way to do it?

@minborg
Copy link
Contributor Author

minborg commented Jan 24, 2023

/label add csr

@openjdk
Copy link

openjdk bot commented Jan 24, 2023

@minborg
The label csr is not a valid label.
These labels are valid:

  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@minborg
Copy link
Contributor Author

minborg commented Jan 24, 2023

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jan 24, 2023
@openjdk
Copy link

openjdk bot commented Jan 24, 2023

@minborg has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@minborg please create a CSR request for issue JDK-8300977 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 21, 2023

@minborg This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@minborg minborg marked this pull request as ready for review March 22, 2023 13:33
@openjdk openjdk bot added rfr Pull request is ready for review and removed csr Pull request needs approved CSR before integration labels Mar 22, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 22, 2023

Webrevs

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

The removal looks okay okay. There is some noise in this patch with changes that are nothing to do with the PR but I think are okay.

nameMax = Integer.MAX_VALUE;
}
return (int)nameMax;
return (int)Math.min(getNameMax0(path), Integer.MAX_VALUE);
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is nothing to do with this issue. It's okay to refactor it as a drive-by change but I think keep nameMax as that made it easier to debug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted

class DefaultFileSystem {
final class DefaultFileSystem {

private DefaultFileSystem() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be another drive-up change, there is only one implementation to making it final might be useful to people reading this code.

if (s != null) return s;
s = getDriveDirectory(i + 1);
driveDirCache[i] = s;
DRIVE_DIR_CACHE[i] = s;
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is nothing to do with this PR but it looks okay.

@@ -142,7 +137,7 @@ public boolean isAbsolute(File f) {

@Override
public boolean isInvalid(File f) {
return f.getPath().indexOf('\u0000') < 0 ? false : true;
return f.getPath().indexOf('\u0000') >= 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be another drive-by change but looks okay.

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

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

Hello Per, the changes look good to me.

I was a bit surprised that the PR didn't have any removal/changes of existing test cases, but looking in the repo I don't see any test using any of these system properties. So it appears that this code was never exercised in recent times.

Please wait for another review from someone with more experience in this area before integrating.

@openjdk
Copy link

openjdk bot commented Mar 28, 2023

@minborg 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:

8300977: Retire java.io.ExpiringCache

Reviewed-by: alanb, jpai

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 897 new commits pushed to the master branch:

  • cddaf68: 8304962: sun/net/www/http/KeepAliveCache/B5045306.java: java.lang.RuntimeException: Failed: Initial Keep Alive Connection is not being reused
  • a06f461: 8303214: Typo in java.util.Collections#synchronizedNavigableMap javadoc
  • 7987ad4: 8304412: Serial: Refactor old generation cards update after Full GC
  • 3c4cd50: 8304963: HttpServer closes connection after processing HEAD after JDK-7026262
  • 4f625c0: 8304543: Modernize debugging jvm args in test/hotspot/jtreg/vmTestbase/nsk/jdi/Argument/value/value004.java
  • 426025a: 8303526: Changing "arbitrary" Name.compareTo() ordering breaks the regression suite
  • 6aec6f3: 8304931: vm/concepts/methods/methods001/methods00101m1/methods00101m1 failures with already pending exception
  • 63ce88b: 8304147: JVM crash during shutdown when dumping dynamic archive
  • 554bccf: 8304448: Kitchensink failed: assert(!thread->is_in_any_VTMS_transition()) failed: class prepare events are not allowed in any VTMS transition
  • 3b88b2a: 8304761: Update IANA Language Subtag Registry to Version 2023-03-22
  • ... and 887 more: https://git.openjdk.org/jdk/compare/048705c04967d106dedc09a4cf2325a3b46ef4e7...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 28, 2023
String s = driveDirCache[i];
// Updates might not be visible to other threads so there
// is no guarantee getDriveDirectory(i+1) is called just once
// for any given value of i.
Copy link
Member

@jaikiran jaikiran Mar 28, 2023

Choose a reason for hiding this comment

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

I found this comment a bit odd in this PR, since this isn't related to any changes in this PR and this behaviour has been this way even in mainline. I'm guessing this has been added just as an informational comment for future maintainers of this code to be aware of this detail; and that's fine with me.

@minborg
Copy link
Contributor Author

minborg commented Mar 28, 2023

/reviewers 2

@openjdk
Copy link

openjdk bot commented Mar 28, 2023

@minborg
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Mar 28, 2023
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 28, 2023
@minborg
Copy link
Contributor Author

minborg commented Mar 28, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Mar 28, 2023

Going to push as commit 927e674.
Since your change was applied there have been 900 commits pushed to the master branch:

  • c90699e: 8304989: unnecessary dash in @param gives double-dash in docs
  • 395a4ce: 8304591: (fs) UnixPath.stringValue need not be volatile
  • 60640a2: 8300979: Lazily initialize (byte, char)arr in java.io.DataInputStream
  • cddaf68: 8304962: sun/net/www/http/KeepAliveCache/B5045306.java: java.lang.RuntimeException: Failed: Initial Keep Alive Connection is not being reused
  • a06f461: 8303214: Typo in java.util.Collections#synchronizedNavigableMap javadoc
  • 7987ad4: 8304412: Serial: Refactor old generation cards update after Full GC
  • 3c4cd50: 8304963: HttpServer closes connection after processing HEAD after JDK-7026262
  • 4f625c0: 8304543: Modernize debugging jvm args in test/hotspot/jtreg/vmTestbase/nsk/jdi/Argument/value/value004.java
  • 426025a: 8303526: Changing "arbitrary" Name.compareTo() ordering breaks the regression suite
  • 6aec6f3: 8304931: vm/concepts/methods/methods001/methods00101m1/methods00101m1 failures with already pending exception
  • ... and 890 more: https://git.openjdk.org/jdk/compare/048705c04967d106dedc09a4cf2325a3b46ef4e7...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 28, 2023
@openjdk openjdk bot closed this Mar 28, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 28, 2023
@openjdk
Copy link

openjdk bot commented Mar 28, 2023

@minborg Pushed as commit 927e674.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants