{"record":{"id":"854a1fb5180cea3a","repo":"apache/beam","slug":"unable-to-read-data","errorCode":null,"errorMessage":"Unable to read data: ","messagePattern":"Unable to read data: ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"sdks/java/io/hadoop-format/src/main/java/org/apache/beam/sdk/io/hadoop/format/HadoopFormatIO.java","lineNumber":960,"sourceCode":"              \"Could not read because the thread got interrupted while \"\n                  + \"reading the records with an exception: \",\n              e);\n        }\n        doneReading = true;\n        return false;\n      }\n\n      @Override\n      public boolean advance() throws IOException {\n        try {\n          progressValue.set(getProgress());\n          if (recordReader.nextKeyValue()) {\n            recordsReturned.incrementAndGet();\n            return true;\n          }\n          doneReading = true;\n        } catch (InterruptedException e) {\n          throw new IOException(\"Unable to read data: \", e);\n        }\n        return false;\n      }\n\n      @Override\n      public KV<K, V> getCurrent() {\n        K key;\n        V value;\n        try {\n          // Transform key if translation function is provided.\n          key =\n              transformKeyOrValue(\n                  recordReader.getCurrentKey(), keyTranslationFunction, keyCoder, skipKeyClone);\n          // Transform value if translation function is provided.\n          value =\n              transformKeyOrValue(\n                  recordReader.getCurrentValue(),\n                  valueTranslationFunction,","sourceCodeStart":942,"sourceCodeEnd":978,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/hadoop-format/src/main/java/org/apache/beam/sdk/io/hadoop/format/HadoopFormatIO.java#L942-L978","documentation":"HadoopInputFormatReader.advance wraps InterruptedException from the underlying Hadoop RecordReader: if the reading thread is interrupted while fetching the next key/value, it rethrows as IOException 'Unable to read data: '. It converts interruption during record iteration into the Beam reader's checked exception type.","triggerScenarios":"Thread interruption during nextKeyValue() in advance() — from runner cancellation, timeout-based preemption, or executor shutdown while draining records.","commonSituations":"Canceling streaming/batch jobs mid-read; Flink/Dataflow checkpoint cancel; VM preemption in managed runners.","solutions":["Retry the pipeline run; interruption is usually external cancellation","Check runner logs for the original interruption source (deadline, cancellation request)","Ensure custom RecordReaders handle InterruptedException by restoring the interrupt flag rather than swallowing it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  boolean has = reader.advance();\n} catch (IOException e) {\n  if (e.getCause() instanceof InterruptedException) {\n    Thread.currentThread().interrupt();\n    throw new CancellationException(\"Read interrupted; pipeline was canceled\");\n  }\n  throw e;\n}","preventionTips":["Treat interruption as cancellation, not a data error — retry at job level","Check runner logs for the source of the interrupt (deadline, cancel API)","Keep per-record work short so interruption is processed promptly"],"tags":["hadoop","interrupted","threading","reader"],"backgroundTag":"thread-interrupted","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}