Repository navigation
Fix Windows CI failures: close TLS cert streams and stop leaking metrics system properties in tests - #16615
Closed
EarthChen wants to merge 2 commits into
Closed
Fix Windows CI failures: close TLS cert streams and stop leaking metrics system properties in tests#16615EarthChen wants to merge 2 commits into
EarthChen wants to merge 2 commits into
Conversation
The streams returned by SslConfig.getXxxPathStream() are file-backed and IOUtils.toByteArray() does not close them. Every TLS connection therefore leaked one FileInputStream per certificate file. On Windows an open handle blocks deletion of the file, which made JUnit @tempdir cleanup fail in ClientTlsHostnameVerificationTest and broke the Windows CI jobs (see #16590's follow-up). Signed-off-by: earthchen <earthchen@apache.org>
…st classes AnnotationIsolationTest set dubbo.metrics.protocol=disabled via SysProps and never cleared it. Dubbo resolves dubbo.metrics.* from system properties with the highest precedence, so any later test class in the same JVM (e.g. SpringBootConfigMetricsTest) failed with 'expected <prometheus> but was <disabled>'. - clear the properties in AnnotationIsolationTest's @AfterEach - guard SpringBootConfigMetricsTest the same way SpringBootConfigPropsTest already does since #16420 Signed-off-by: earthchen <earthchen@apache.org>
Member
Author
|
Closing: reopening from my fork per contribution workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16615 +/- ##
=============================================
+ Coverage 36.89% 61.24% +24.34%
- Complexity 11753 11768 +15
=============================================
Files 1952 1953 +1
Lines 89387 89411 +24
Branches 13420 13502 +82
=============================================
+ Hits 32983 54757 +21774
+ Misses 51800 29034 -22766
- Partials 4604 5620 +1016
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the two persistent unit-test failures on the
3.3branch CI (Windows jobs red since #16590,SpringBootConfigMetricsTestfailing intermittently on ubuntu):SSLConfigCertProviderleaked oneFileInputStreamper certificate file on every TLS connection.IOUtils.toByteArray(InputStream)does not close its input. On Linux/macOS deleting an open file succeeds, but on Windows the open handle blocks deletion of the JUnit@TempDir, soClientTlsHostnameVerificationTest(introduced by Pass the peer address to the TCP TLS client engine #16590) errored withFailed to close extension context ... ca.pem, client.key, client.pem— exactly the three files this provider reads. The leaked files list matches the streams opened here one-to-one; the server-sideSslContextBuilder.forServer(File, File)reads (closed by Netty) never appeared in the failure. This is also a production fd leak (one per cert per connection attempt).AnnotationIsolationTestsetdubbo.metrics.protocol=disabledviaSysPropsand never cleaned it up. Dubbo resolvesdubbo.metrics.*from system properties with the highest precedence, so any later test class in the same JVM failed.SpringBootConfigMetricsTestdied withexpected: <prometheus> but was: <disabled>. fix: make SpringBootConfigPropsTest immune to leaked metrics System properties #16420 already added theSystem.clearPropertyguard toSpringBootConfigPropsTest; this adds the same guard toSpringBootConfigMetricsTestand removes the leak source inAnnotationIsolationTest(@AfterEach).The Samples Test
Build test imagefailures seen on the same runs are unrelated: the nacos-mysql sample Dockerfile hit a transient HTTP 503 pullingmysql-schema.sqlfrom GitHub.Evidence
Reproduced locally on 3.3 (macOS, JDK 17) by injecting the leaked property, mirroring the CI failure mechanism:
Full regression on the touched module (matches the CI test count):
Note: the Windows-only
@TempDirdeletion failure cannot be reproduced on macOS (Linux/macOS allow deleting open files); the fix closes the exact handles the CI stack trace reported as undeletable. The Windows CI legs are the final verifier.Merge Danger
Door: two-way
Blast Radius: small — closing streams that are already fully consumed (read to
byte[]) before use; no behavior change on Linux/macOS, removes a production fd leak on all platforms. Test-only changes besidesSSLConfigCertProvider.Made with Cursor