apache/hadoop · error · InterruptedIOException
Read request interrupted
Error message
Read request interrupted
What it means
StripeReader throws InterruptedIOException("Read request interrupted") when the thread performing an erasure-coded read is interrupted while waiting for striped chunk read futures. The client closes all current block readers and cancels pending futures, deliberately skipping decode because a partially read stripe would produce corrupt data.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/StripeReader.java:403
} else {
returnedChunk.state = StripingChunk.MISSING;
// close the corresponding reader
dfsStripedInputStream.closeReader(readerInfos[r.index]);
final int missing = alignedStripe.missingChunksNum;
alignedStripe.missingChunksNum++;
checkMissingBlocks();
readDataForDecoding();
readParityChunks(alignedStripe.missingChunksNum - missing);
}
} catch (InterruptedException ie) {
String err = "Read request interrupted";
DFSClient.LOG.error(err, ie);
dfsStripedInputStream.closeCurrentBlockReaders();
clearFutures();
// Don't decode if read interrupted
throw new InterruptedIOException(err);
}
}
if (alignedStripe.missingChunksNum > 0) {
decode();
}
}
/**
* Some fetched {@link StripingChunk} might be stored in original application
* buffer instead of prepared decode input buffers. Some others are beyond
* the range of the internal blocks and should correspond to all zero bytes.
* When all pending requests have returned, this method should be called to
* finalize decode input buffers.
*/
void finalizeDecodeInputs() {
for (int i = 0; i < alignedStripe.chunks.length; i++) {View on GitHub (pinned to 2add963021)
Solutions
- If the interrupt is intentional cancellation, treat InterruptedIOException as a clean stop and unwind without retrying
- Stop using Future.cancel(true) or shutdownNow() on threads that own HDFS reads; use cooperative cancellation flags
- Restore the interrupt flag when catching so upper layers still observe the cancellation
- If interrupts are unexpected, audit which component calls Thread.interrupt() on the reader thread
Example fix
// before: interrupt leaks and the read state is unclear
Future<byte[]> f = pool.submit(readTask);
f.cancel(true);
// after: cooperative cancellation, and clean interrupt handling in the reader
try {
return readTask.call();
} catch (InterruptedIOException e) {
Thread.currentThread().interrupt();
throw e;
} Defensive patterns
Strategy: try-catch
Try / catch
try {
in.read(buf, off, len);
} catch (InterruptedIOException e) {
Thread.currentThread().interrupt(); // preserve cancellation
// expected on shutdown/cancel: stop reading, do not retry Prevention
- Never cancel reader threads with Future.cancel(true) or shutdownNow(); signal cooperation via flags
- Restore the interrupt flag in every catch of InterruptedIOException/InterruptedException
- Treat this exception as an expected outcome during job cancellation, not a defect to fix
When it happens
Trigger: Thread interrupt during an EC file read: Future.cancel(true), ExecutorService.shutdownNow(), framework task cancellation/timeouts (MapReduce/Spark killing the reader thread), or JVM shutdown hooks interrupting in-flight reads.
Common situations: Job or task cancellation while reading EC files; query timeouts that interrupt worker threads; test harnesses that interrupt reader threads; shutdownNow() on pools that own HDFS reads.
Related errors
- Interrupted while listing using DFS, prefix={}, marker={}
- FileSystem ${item.fs.getUri()} does not support Erasure Codi
- Call interrupted
- Interrupted while waiting for IO on channel {}. Total timeou
- Another {name} is running.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/17969c3db0414efb.
Report an issue: GitHub.