Skip to content

HDFS-4277. SocketTimeoutExceptions over the DataXceiver service of a DN should print the DFSClient ID#8271

Open
balodesecurity wants to merge 1 commit intoapache:trunkfrom
balodesecurity:HDFS-4277
Open

HDFS-4277. SocketTimeoutExceptions over the DataXceiver service of a DN should print the DFSClient ID#8271
balodesecurity wants to merge 1 commit intoapache:trunkfrom
balodesecurity:HDFS-4277

Conversation

@balodesecurity
Copy link

Summary

  • When a SocketTimeoutException (or other error) occurs in the DataXceiver service, the log messages did not include the DFSClient ID, making it impossible to trace which client caused the error.
  • Added previousOpClientName (the DFSClient ID) to the shared error string in run()'s catch block, which covers all error paths including SocketTimeoutException during READ_BLOCK.
  • Also added clientName to exception log messages directly in readBlock(), writeBlock(), and transferBlock() for completeness.

Changes

  • DataXceiver.run(): include previousOpClientName in the error string used across all exception branches
  • DataXceiver.readBlock(): add clientName to SocketException (TRACE) and IOException (WARN) log messages
  • DataXceiver.writeBlock(): add clientname to the IOException log message
  • DataXceiver.transferBlock(): add clientName to the IOException log message

Test plan

  • Existing TestDataXceiverBackwardsCompat passes
  • Existing TestDataXceiverLazyPersistHint passes
  • CI (Yetus) build passes on trunk

🤖 Generated with Claude Code

…DN should print the DFSClient ID.

Include previousOpClientName in the DataXceiver error string so that
SocketTimeoutException logs (and all other DataXceiver error logs) show
which DFSClient was connected at the time of the error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 21s 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 doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 28m 17s trunk passed
+1 💚 compile 0m 53s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 0m 57s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 1m 1s trunk passed
+1 💚 mvnsite 0m 59s trunk passed
+1 💚 javadoc 0m 52s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 56s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 11s trunk passed
+1 💚 shadedclient 16m 39s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 43s the patch passed
+1 💚 compile 0m 37s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 0m 37s the patch passed
+1 💚 compile 0m 44s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 0m 44s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 42s the patch passed
+1 💚 mvnsite 0m 44s the patch passed
+1 💚 javadoc 0m 33s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 34s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 59s the patch passed
+1 💚 shadedclient 16m 17s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 175m 54s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 25s The patch does not generate ASF License warnings.
251m 56s
Reason Tests
Failed junit tests hadoop.hdfs.tools.TestDFSAdmin
Subsystem Report/Notes
Docker ClientAPI=1.53 ServerAPI=1.53 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8271/1/artifact/out/Dockerfile
GITHUB PR #8271
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux efcb0d9e0f13 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / e80c2ca
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8271/1/testReport/
Max. process+thread count 4204 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8271/1/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@balodesecurity
Copy link
Author

This change is purely additive to logging — it only includes the DFSClient ID in existing error log messages in DataXceiver.java. No functional behavior, control flow, or data handling is modified. The existing test suite fully validates the unchanged logic. Adding new unit tests for a log message change would not provide meaningful coverage beyond what is already present.

@balodesecurity
Copy link
Author

The TestDFSAdmin failure in the CI run is a pre-existing flaky test unrelated to this patch, fixed by HDFS-17885 (PR #8269, merged Feb 23).

@balodesecurity
Copy link
Author

CC @cnauroth @aajisaka — would appreciate a review when you have a chance. This is a small logging improvement that adds the DFSClient ID to error messages in DataXceiver.java to make debugging client-specific failures easier.

@balodesecurity
Copy link
Author

retest this please

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.

3 participants