[PATCH] 8246633: Improve the performance of ObjectInputStream.resolveClass(ObjectStreamClass)
Peter Kessler (Open Source)
peter.kessler at os.amperecomputing.com
Fri Jun 12 20:04:51 UTC 2020
Daniel,
Thanks for the suggestions to increase the timeout and lower the
concurrency. I did Bad Science(TM) and changed them both at the same
time. I am now running
$ jtreg-5.0-b01/bin/jtreg \
-verbose:summary -a -ea -esa -agentvm -conc:1 -ignore:quiet -timeout:4 \
-exclude:./test/jdk/ProblemList.txt \
-jdk:${jdk} \
./test/jdk/:jdk_core ./test/jdk/:jdk_svc
I only had time for 2 tests of each jdk overnight, because running that
way takes much longer, but the results are less confusing.
Running on x86_64, counting failures and errors in 2 runs with OracleJDK
build 15-ea+25-1229
2 Error: java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java
2 Error: java/lang/instrument/HiddenClass/HiddenClassAgent.java
2 Error: java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java
2 Error: java/lang/String/nativeEncoding/StringPlatformChars.java
2 Error: java/nio/channels/FileChannel/directio/DirectIOTest.java
2 Error: java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java
2 Error: jdk/internal/loader/NativeLibraries/Main.java
2 Error: Some tests failed or other problems occurred.
2 Error: sun/management/jmxremote/bootstrap/CustomLauncherTest.java
2 Error: tools/launcher/JliLaunchTest.java
1 FAILED: com/sun/jdi/PrivateTransportTest.java
1 FAILED: java/io/Serializable/unresolvableObjectStreamClass/UnresolvableObjectStreamClass.java
1 FAILED: java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java
1 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java
1 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java
2 FAILED: jdk/nio/zipfs/ZipFSTester.java
2 FAILED: sun/security/pkcs11/Secmod/AddTrustedCert.java
2 FAILED: tools/jlink/plugins/StripNativeDebugSymbolsPlugin/StripNativeDebugSymbolsPluginTest.java
1 Test results: passed: 6,714; failed: 8; error: 9
1 Test results: passed: 6,719; failed: 3; error: 9
versus 2 runs of my build of OpenJDK-15+25 with the proposed patch
2 Error: java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java
2 Error: java/lang/instrument/HiddenClass/HiddenClassAgent.java
2 Error: java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java
2 Error: java/lang/String/nativeEncoding/StringPlatformChars.java
2 Error: java/nio/channels/FileChannel/directio/DirectIOTest.java
2 Error: java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java
2 Error: jdk/internal/loader/NativeLibraries/Main.java
2 Error: Some tests failed or other problems occurred.
2 Error: sun/management/jmxremote/bootstrap/CustomLauncherTest.java
2 Error: tools/launcher/JliLaunchTest.java
2 FAILED: com/sun/jdi/PrivateTransportTest.java
2 FAILED: java/io/Serializable/unresolvableObjectStreamClass/UnresolvableObjectStreamClass.java
2 FAILED: java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java
2 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java
2 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java
2 FAILED: jdk/nio/zipfs/ZipFSTester.java
2 FAILED: sun/security/lib/cacerts/VerifyCACerts.java
2 FAILED: sun/security/pkcs11/Secmod/AddTrustedCert.java
2 FAILED: tools/jlink/plugins/StripNativeDebugSymbolsPlugin/StripNativeDebugSymbolsPluginTest.java
2 Test results: passed: 6,716; failed: 9; error: 9
The patched runs fail more consistently, but I don't know if that is
good or bad.(:-) The only difference in the failure lists is on my
build, where
sun/security/lib/cacerts/VerifyCACerts.java
fails. That seems to be because my built lib/security/cacerts is
different from the one in 15-ea+25-1229.
$ ls -l OracleJDK/jdk-15-ea+25/lib/security/cacerts OpenJDK/jdk-15+25+ClassLoaderRegistry/lib/security/cacerts
-rw-r--r-- 1 pkessler pkessler 101001 May 28 08:47 OracleJDK/jdk-15-ea+25/lib/security/cacerts
-rw-rw-r-- 1 pkessler pkessler 154279 Jun 3 17:04 OpenJDK/jdk-15+25+ClassLoaderRegistry/lib/security/cacerts
I don't know why that difference exists, but it probably not due to the
patch. (If I build a clone of OpenJDK-15+25, I get the identical,
larger, lib/security/cacerts file.) If I copy the lib/security/cacerts
file from 15-ea+25-1229 to my build then
sun/security/lib/cacerts/VerifyCACerts.java passes.
My aarch64 runs also show that the only difference in failures is
sun/security/lib/cacerts/VerifyCACerts.java.
You asked after my /etc/hosts file and whether "localhost" resolves to
the loopback address. My /etc/hosts files on both x86_64 and aarch64
contain
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
so that looks all proper and correct. And changing the concurrrency and
timeout seems to have cleared up the httpclient failures.
What further testing do you suggest?
... peter
-----Original Message-----
From: Daniel Fuchs <daniel.fuchs at oracle.com>
Date: Thursday, June 11, 2020 at 12:31 PM
To: Peter Kessler OS <peter.kessler at os.amperecomputing.com>, "core-libs-dev at openjdk.java.net" <core-libs-dev at openjdk.java.net>
Subject: Re: [PATCH] 8246633: Improve the performance of ObjectInputStream.resolveClass(ObjectStreamClass)
Hi Peter,
I am surprised by the java/net/httpclient failures: these tests
have been quite stable for me. Is your repository up to date?
Or are these maybe failing in timeout, in which case you might
need to increase the timeout factor (-timeout) or lower the
concurrency (-conc). Or maybe you have some weird configuration
in your /etc/hosts - issues have been known to happen if
looking up "localhost" doesn't resolve to the loopback address.
I any case I'd be curious to see the reason for those failures.
best regards
-- daniel
On 11/06/2020 19:14, Peter Kessler OS wrote:
> Daniel,
>
> Thanks for the suggestion to run more tests.
>
> I'm not sure what the criteria for "success" is here.
>
> I have run
>
> $ jtreg-5.0-b01/bin/jtreg \
> -verbose:summary -a -ea -esa -agentvm -conc:8 -ignore:quiet -timeout:2 \
> -exclude:./test/jdk/ProblemList.txt \
> -jdk:${jdk} \
> ./test/jdk/:jdk_core ./test/jdk/:jdk_svc
>
> on aarch64 and x86_64, using the available OracleJDK build 15-ea+25-1229,
> and a build I did of jdk-15+25 with the patch (called jdk-15+25+ below).
> The results are ... confusing.
>
> I ran the tests 4 times on each JDK. The summary of the results on x86_64
> are
>
> 15-ea+25-1229
> Test results: passed: 6,718; failed: 4; error: 9
> Test results: passed: 6,708; failed: 13; error: 10
> Test results: passed: 6,713; failed: 9; error: 9
> Test results: passed: 6,718; failed: 4; error: 9
>
> jdk-15+25+
> Test results: passed: 6,719; failed: 6; error: 9
> Test results: passed: 6,712; failed: 12; error: 10
> Test results: passed: 6,718; failed: 7; error: 9
> Test results: passed: 6,718; failed: 7; error: 9
>
> The fact that in different runs different tests pass, fail, or error is
> unfortunate. Counting the different failures in the 4 runs shows
>
> 15-ea+25-1229
> 3 FAILED: com/sun/jdi/PrivateTransportTest.java
> 1 FAILED: java/io/Serializable/unresolvableObjectStreamClass/UnresolvableObjectStreamClass.java
> 1 FAILED: java/net/httpclient/ProxyAuthDisabledSchemes.java
> 2 FAILED: java/net/httpclient/ProxyAuthDisabledSchemesSSL.java
> 1 FAILED: java/net/httpclient/ResponseBodyBeforeError.java
> 1 FAILED: java/net/httpclient/ResponsePublisher.java
> 2 FAILED: java/net/httpclient/ShortResponseBody.java
> 2 FAILED: java/net/httpclient/ShortResponseBodyWithRetry.java
> 1 FAILED: java/net/httpclient/SpecialHeadersTest.java
> 1 FAILED: java/net/httpclient/StreamingBody.java
> 4 FAILED: java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java
> 1 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java
> 2 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java
> 4 FAILED: sun/security/pkcs11/Secmod/AddTrustedCert.java
> 4 FAILED: tools/jlink/plugins/StripNativeDebugSymbolsPlugin/StripNativeDebugSymbolsPlugin
>
> jdk-15+25+
> 1 FAILED: com/sun/jdi/PrivateTransportTest.java
> 3 FAILED: java/io/Serializable/unresolvableObjectStreamClass/UnresolvableObjectStreamClass.java
> 1 FAILED: java/net/httpclient/ProxyAuthDisabledSchemes.java
> 1 FAILED: java/net/httpclient/ProxyAuthDisabledSchemesSSL.java
> 1 FAILED: java/net/httpclient/ResponsePublisher.java
> 1 FAILED: java/net/httpclient/ShortResponseBody.java
> 1 FAILED: java/net/httpclient/ShortResponseBodyWithRetry.java
> 1 FAILED: java/net/httpclient/SpecialHeadersTest.java
> 1 FAILED: java/net/httpclient/SplitResponseAsync.java
> 1 FAILED: java/net/httpclient/StreamingBody.java
> 1 FAILED: java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java
> 3 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java
> 2 FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java
> 1 FAILED: java/util/logging/Logger/bundleLeak/BundleTest.java
> 1 FAILED: jdk/jfr/event/runtime/TestThreadAllocationEvent.java
> 4 FAILED: sun/security/lib/cacerts/VerifyCACerts.java
> 4 FAILED: sun/security/pkcs11/Secmod/AddTrustedCert.java
> 4 FAILED: tools/jlink/plugins/StripNativeDebugSymbolsPlugin/StripNativeDebugSymbolsPluginTest.java
>
> To your worry about "potential damage", I would have worried about
> java/io/Serializable/unresolvableObjectStreamClass/UnresolvableObjectStreamClass.java,
> except it did not fail all the time with the patch, and it also failed
> without the patch. Many of the other failures seem intermittent. I am not
> sure how to classify the failures that persisted across the 4 runs I did.
>
> The summary of the results on aarch64 is not as good, for either build:
>
> 15-ea+25-1229
> Test results: passed: 6,658; failed: 74; error: 10
> Test results: passed: 6,657; failed: 74; error: 11
> Test results: passed: 6,660; failed: 71; error: 10
> Test results: passed: 6,663; failed: 69; error: 10
>
> jdk-15+25+
> Test results: passed: 6,661; failed: 73; error: 11
> Test results: passed: 6,659; failed: 75; error: 10
> Test results: passed: 6,663; failed: 71; error: 11
> Test results: passed: 6,655; failed: 79; error: 11
>
> Comparing the failures and errors in 3rd run of each, the differences from
> 15-ea+25-1229 to jdk-15+25+ are
>
> > Error: sun/tools/jstatd/TestJstatdExternalRegistry.java
> < FAILED: com/sun/jdi/PrivateTransportTest.java
> > FAILED: java/io/Serializable/unresolvableObjectStreamClass/UnresolvableObjectStreamClass.java
> < FAILED: java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java
> < FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java
> > FAILED: jdk/net/ExtendedSocketOption/AsynchronousSocketChannelNAPITest.java
> > FAILED: sun/security/lib/cacerts/VerifyCACerts.java
>
> Again, UnresolvableObjectStreamClass.java would be worrying, except that it
> did not always fail with the patch and also sometimes (not shown) failed
> with the OracleJDK 15-ea+25-1229 build.
>
> Comparing the failures across the 4 runs shows the difference between the
> persistent (that is, they failed on all 4 runs) between 15-ea+25-1229 and
> jdk-15+25+ to be
>
> < FAILED: com/sun/jdi/PrivateTransportTest.java
> < FAILED: java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java
> > FAILED: sun/security/lib/cacerts/VerifyCACerts.java
>
> Similar to, but not the same as, the persistent failures on x86_64.
>
> (Can I attribute the generally higher rate of failure on aarch64 compared to
> x86_64 to fact that aarch64 is a new platform for Oracle?)
>
> What further testing would you recommend?
>
> ... peter
>
> -----Original Message-----
> From: Daniel Fuchs <daniel.fuchs at oracle.com>
> Date: Tuesday, June 9, 2020 at 10:18 AM
> To: Peter Kessler OS <peter.kessler at os.amperecomputing.com>, "core-libs-dev at openjdk.java.net" <core-libs-dev at openjdk.java.net>
> Subject: Re: [PATCH] 8246633: Improve the performance of ObjectInputStream.resolveClass(ObjectStreamClass)
>
> Hi Peter,
>
> This is not a review. I second Roger's observations.
>
> On 05/06/2020 00:08, Peter Kessler OS wrote:
> > Tested with `make run-test-tier1` on Linux (CentOS 7) on both aarch64 and x86_64. I had one failure on each of the runs
>
> The code you are proposing to change affects RMI and JMX too.
> For an initial evaluation of the potential damage you will need to
> test at least with jdk_core and jdk_svc (and if that's successful
> then probably some of the lower tiers too):
>
> $ jtreg -verbose:summary -a -ea -esa -agentvm -conc:8 -ignore:quiet
> -timeout:2 -exclude:./test/jdk/ProblemList.txt -jdk:<tested-jdk>
> ./test/jdk/:jdk_core ./test/jdk/:jdk_svc
>
>
> best regards,
>
> -- daniel
>
More information about the core-libs-dev
mailing list