[8.6.0] Refactor TLS error handling (Backport fix for #28459)#28461
[8.6.0] Refactor TLS error handling (Backport fix for #28459)#28461Ashutosh0x wants to merge 2 commits intobazelbuild:release-8.6.0from
Conversation
There was a problem hiding this comment.
Code Review
This pull request is a major update, bumping the Bazel version to 9.0.0 and overhauling CI configurations, dependencies, and build settings. It also introduces a substantial amount of new documentation and tooling. My review identifies a few high-severity concerns in the new configurations that could impact CI stability and build correctness. These include potentially incorrect test scoping in CI, improper flag application in .bazelrc, and a possible version mismatch in a dependency patch. None of the comments were dropped or modified based on the provided rules, as they did not directly apply to the specific issues raised.
03c9588 to
1d8bce1
Compare
| while (t != null) { | ||
| if (t instanceof CertificateException || t instanceof CertPathValidatorException) { | ||
| String message = "TLS error: " + e.getMessage(); | ||
| eventHandler.handle(Event.progress(message)); |
There was a problem hiding this comment.
It doesn't look right to report one event per cause. Could we report just the outer exception's message?
1d8bce1 to
7ac214c
Compare
|
Addressed @fmeum's review feedback: Changes made:
The code now clearly shows that:
This addresses the concern about potentially reporting one event per cause. |
|
Regarding the gemini-code-assist bot review comments: The bot appears to have analyzed files that are not part of this PR diff. This PR only modifies \HttpConnector.java\ to fix TLS error handling. To clarify:
The bot's comments about version mismatches (6.5/6.6) appear to be hallucinated. |
|
Thank you for bringing this to my attention, @Ashutosh0x. I apologize for the incorrect review comments regarding files outside the scope of this pull request. My analysis mistakenly included files that were not part of the diff, leading to irrelevant suggestions. I understand that this PR specifically modifies Your feedback is valuable and helps me improve. I am an AI and sometimes make mistakes, and I appreciate you pointing out these inaccuracies. |
@fmeum Ai can make mistakes 😂 |
|
Ive refactored the TLS error handling to properly inspect the exception cause chain for certificate errors, ensuring we only fail over when it's appropriate. I also fixed the missing SSLException import and removed the accidentally committed merge conflict markers. The CI should be much cleaner now. @fmeum, could you take another look? |
|
@Ashutosh0x Can you explain what's the difference between this PR and #28459?
|
Address @fmeum's review feedback: refactored the SSL exception handling to first check the entire cause chain for certificate errors using a for loop, then report a single event only if a certificate error is found. This ensures we report just the outer exception's message once, rather than appearing to report one event per cause. Changes: - Use a for-loop instead of while to inspect the exception cause chain - Set a boolean flag when a certificate error is found - Report the TLS error event only once after the loop completes - Use the outer SSLException's message as requested
7ac214c to
e932303
Compare
|
@meteorcloudy Thank you for the review and suggestions! Difference from #28459:
Tests Added:
All 36 Ready for another review! |
|
@Ashutosh0x Don't we also need to make changes for |
This commit adds the missing test case from PR bazelbuild#28459 as requested by @iancha1992. The changes include: - Updated imports to use FileSystemUtils instead of DataInputStream - Replaced the readFile() method with FileSystemUtils.readContent() - Added downloadFrom2UrlsFirstTlsErrorSecondOk() test to verify TLS error failover behavior These changes ensure that the test coverage for TLS error handling is complete and consistent with the main PR bazelbuild#28459.
|
@iancha1992 Thank you for the review. I've added the missing changes to HttpDownloaderTest.java from PR #28459. Changes made in commit 34ad9b1:
This test validates that when the first URL encounters a TLS/SSL error, the downloader correctly fails over to the second URL and completes the download successfully. The PR is now fully aligned with #28459. |
|
merging #28459 instead. |
Pull request was closed
This PR provides a robust fix for the TLS error handling logic originally proposed in #28459. It addresses the review feedback by inspecting the exception cause chain for certificate errors instead of checking exception messages strings.
Supersedes #28459.