Skip to content

HADOOP-19997. TestSSLHttpServerMTLS.testUntrustedClientIsRejected fails intermittently with SocketException instead of SSLHandshakeException - #8780

Closed
joseluisll wants to merge 1 commit into
apache:trunkfrom
joseluisll:ccr-665a230c-q2hniq
Closed

joseluisll wants to merge 1 commit into
apache:trunkfrom
joseluisll:ccr-665a230c-q2hniq

Conversation

@joseluisll

@joseluisll joseluisll commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Description of PR

https://issues.apache.org/jira/browse/HADOOP-19997

testUntrustedClientIsRejected expects an SSLHandshakeException. When the server rejects the client certificate, it closes the connection while the client is still sending its last handshake message. Depending on timing and TLS version, the client sees an SSLHandshakeException, a SocketException, or a plain IOException. The test only accepts the first, so it fails intermittently.

The test now checks that the request is refused, whatever the exception:

  • getResponseCode() must throw an IOException. It returns HTTP error codes instead of throwing, so a 403 or 500 would still fail the test.
  • The exception must not be a ConnectException, which would mean the server was never reached.

Test-only change, one file.

How was this patch tested?

OpenJDK 21, 50 runs each:

Client protocol trunk patch
JDK default 48/50 (2 × SocketException) 50/50
TLSv1.2 42/50 (8 × SocketException) 50/50

TestSSLHttpServerMTLS passes under mvn test. Checkstyle is clean.

For code changes:

  • Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: Have the integration tests been executed and the endpoint
    declared according to the connector-specific documentation? (N/A)
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0? (N/A)
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files? (N/A)

AI Tooling

If an AI tool was used:

Contains content generated by Claude Code.

…ls intermittently with SocketException instead of SSLHandshakeException.

The server rejects the untrusted client certificate and drops the
connection at once, racing the client's last handshake flight. How the
refusal reaches the client depends on who wins and on the TLS version:
SSLHandshakeException under TLSv1.2, SocketException when the close
wins, and a bare IOException on the request write under TLSv1.3. Assert
that getResponseCode() fails below HTTP with anything but a
ConnectException, rather than which exception carries the refusal.

Split out of HADOOP-19979.

Contains content generated by Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joseluisll joseluisll closed this Oct 3, 2026
@joseluisll
joseluisll deleted the ccr-665a230c-q2hniq branch October 3, 2026 07:27
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 19m 47s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 48m 41s trunk passed
+1 💚 compile 19m 6s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 18m 24s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 31s trunk passed
+1 💚 mvnsite 2m 1s trunk passed
+1 💚 javadoc 1m 28s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 1m 23s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
-1 ❌ spotbugs 3m 19s /branch-spotbugs-hadoop-common-project_hadoop-common-warnings.html hadoop-common-project/hadoop-common in trunk has 1 extant spotbugs warnings.
+1 💚 shadedclient 36m 43s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 37m 19s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 16s the patch passed
+1 💚 compile 17m 6s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 17m 6s the patch passed
+1 💚 compile 18m 35s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 18m 35s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 25s the patch passed
+1 💚 mvnsite 1m 59s the patch passed
+1 💚 javadoc 1m 23s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 1m 24s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 3m 25s the patch passed
+1 💚 shadedclient 36m 47s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 24m 29s hadoop-common in the patch passed.
+1 💚 asflicense 1m 16s The patch does not generate ASF License warnings.
262m 49s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8780/1/artifact/out/Dockerfile
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux a1757193ca99 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6670ae6
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8780/1/testReport/
Max. process+thread count 3036 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8780/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants