Skip to content

HDFS-17845. DataStreamer QuotaExceededException should be thrown to Client.#8321

Open
balodesecurity wants to merge 2 commits intoapache:trunkfrom
balodesecurity:HDFS-17845
Open

HDFS-17845. DataStreamer QuotaExceededException should be thrown to Client.#8321
balodesecurity wants to merge 2 commits intoapache:trunkfrom
balodesecurity:HDFS-17845

Conversation

@balodesecurity
Copy link

Summary

Fixes two related problems when a QuotaExceededException (e.g. disk-space quota) is thrown during DataStreamer.addBlock():

  1. Silent swallow / no WARN log — the exception was caught and logged only at DEBUG level, making quota failures invisible in production logs.
  2. Exception never reaches the client — because the namenode returns no datanode list when quota is exceeded, the output stream is never created and lastException is never surfaced, leaving the client blocked indefinitely.

Changes

DataStreamer.java

  • Remove the QuotaExceededException-specific DEBUG branch; all DataStreamer exceptions now emit a WARN log.
  • After setting lastException, set streamerClosed = true and notifyAll() on dataQueue for QuotaExceededException so the client thread is unblocked immediately.

TestAbandonBlock.java

  • Add testQuotaExceptionPropagatedToClient: sets a 1-byte space quota on a directory, appends enough bytes to trigger a second addBlock, and asserts that:
    • DSQuotaExceededException is propagated to the caller.
    • A WARN-level "DataStreamer Exception" log entry is emitted.

Test plan

  • TestAbandonBlock#testQuotaExceptionPropagatedToClient passes locally ✅
  • Full module build passes (mvn package ... -DskipTests) ✅

…lient.

Previously, QuotaExceededException was silently swallowed in the
DataStreamer exception handler: it was logged only at DEBUG level and
streamerClosed was not set, so the client never received the error
and the stream stalled indefinitely.

Changes:
- Remove the special-case DEBUG log for QuotaExceededException;
  all DataStreamer exceptions now emit a WARN log.
- Set streamerClosed=true and notify dataQueue when a
  QuotaExceededException is caught, so the client thread is
  unblocked and the exception propagates immediately.
- Add TestAbandonBlock#testQuotaExceptionPropagatedToClient to
  verify that DSQuotaExceededException reaches the caller and that
  a WARN log entry is emitted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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