JDK-8235966 : Process obsolete flags less aggressively
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-12-16
  • Updated: 2021-06-10
  • Resolved: 2020-01-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b08Fixed
Related Reports
Relates :  
Description
If a flag is declared in the flag table to become obsolete in JDK N then as soon as we switch to version N we start ignoring the flag. That can cause tests using the flag to fail and this can impact nightly testing significantly.

I don't think it is reasonable to expect all the obsoletion work related to a flag to happen immediately upon a version update. So I think that until the flag (and related code) is actually deleted from the source code, the fact it is recorded as "obsolete" should trigger a temporary warning:

Warning: UseXXX is marked for obsoletion in this release of the JDK

and we continue to process the flag as in the prior release.

However we still need to ensure we don't ship a release where we forgot to do the actual obsoletion of a flag that was listed as obsolete. Not sure how to handle that ...

Update: after further discussion it has been proposed that we use the build number as the trigger for a whitebox or gtest that performs the currently disabled full verification of the flag table. So if a flag has not be obsoleted or expired as it should by build N** then we fail the gtest. This will complement the relaxing of the obsoletion check at the start of the release cycle.

** the value of N is TBD but given a 6 month release cycle and approximately weekly builds then we can easily pick a good value. 20 seems good - should be ~2/3 through the release but before RDP2.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/11e188a95589 User: dholmes Date: 2020-01-24 02:16:37 +0000
24-01-2020

The warnings are only enabled upon request which is now done via gtest. Here's the results for build 20: Test selection 'gtest:special_flags', will run: * gtest:special_flags/server Running test 'gtest:special_flags/server' Note: Google Test filter = special_flags* [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from special_flags [ RUN ] special_flags.verify_special_flags_test_vm Java HotSpot(TM) 64-Bit Server VM warning: Global variable for obsolete special flag entry "MonitorBound" should be removed Java HotSpot(TM) 64-Bit Server VM warning: Global variable for obsolete special flag entry "UseParallelOldGC" should be removed open/test/hotspot/gtest/runtime/test_special_flags.cpp:35: Failure Value of: Arguments::verify_special_jvm_flags(true) Actual: false Expected: true Special flag verification failed [ FAILED ] special_flags.verify_special_flags_test_vm (0 ms) [----------] 1 test from special_flags (245 ms total) [----------] Global test environment tear-down ERROR: RUN_ALL_TESTS() failed. Error 1 [==========] 1 test from 1 test case ran. (245 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] special_flags.verify_special_flags_test_vm 1 FAILED TEST --- and here for build 0: Test selection 'gtest:special_flags', will run: * gtest:special_flags/server Running test 'gtest:special_flags/server' Note: Google Test filter = special_flags* [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from special_flags [ RUN ] special_flags.verify_special_flags_test_vm [ OK ] special_flags.verify_special_flags_test_vm (0 ms) [----------] 1 test from special_flags (222 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (222 ms total) [ PASSED ] 1 test. Finished running test 'gtest:special_flags/server' Test report is stored in /scratch/users/daholme/jdk-dev2/build/linux-x64-debug/test-results/gtest_special_flags_server ============================== Test summary ============================== TEST TOTAL PASS FAIL ERROR gtest:special_flags/server 1 1 0 0 ============================== TEST SUCCESS
20-01-2020

Example output: case 1: build 0 (default dev build) > ./build/linux-x64-debug/images/jdk/bin/java -XX:+UseParallelOldGC -version Java HotSpot(TM) 64-Bit Server VM warning: Temporarily processing option UseParallelOldGC; support is scheduled for removal in 15.0 java version "15-internal" 2020-09-15 Java(TM) SE Runtime Environment (fastdebug build 15-internal+0-2019-12-16-0257491.daholme...) Java HotSpot(TM) 64-Bit Server VM (fastdebug build 15-internal+0-2019-12-16-0257491.daholme..., mixed mode, sharing) case 2: build 20 > ./build/linux-x64-debug/images/jdk/bin/java -version Java HotSpot(TM) 64-Bit Server VM warning: Global variable for obsolete special flag entry "MonitorBound" should be removed Java HotSpot(TM) 64-Bit Server VM warning: Global variable for obsolete special flag entry "UseParallelOldGC" should be removed java version "15-internal" 2020-09-15 Java(TM) SE Runtime Environment (fastdebug build 15-internal+20-2019-12-16-0257491.daholme...) Java HotSpot(TM) 64-Bit Server VM (fastdebug build 15-internal+20-2019-12-16-0257491.daholme..., mixed mode, sharing)
16-01-2020