{"record":{"id":"737fc5f8342cacc9","repo":"apache/flink","slug":"could-not-get-splits","errorCode":null,"errorMessage":"Could not get Splits.","messagePattern":"Could not get Splits\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java","lineNumber":166,"sourceCode":"    }\n\n    @Override\n    public HadoopInputSplit[] createInputSplits(int minNumSplits) throws IOException {\n        configuration.setInt(\"mapreduce.input.fileinputformat.split.minsize\", minNumSplits);\n\n        JobContext jobContext = new JobContextImpl(configuration, new JobID());\n\n        jobContext.getCredentials().addAll(this.credentials);\n        Credentials currentUserCreds = getCredentialsFromUGI(UserGroupInformation.getCurrentUser());\n        if (currentUserCreds != null) {\n            jobContext.getCredentials().addAll(currentUserCreds);\n        }\n\n        List<org.apache.hadoop.mapreduce.InputSplit> splits;\n        try {\n            splits = this.mapreduceInputFormat.getSplits(jobContext);\n        } catch (InterruptedException e) {\n            throw new IOException(\"Could not get Splits.\", e);\n        }\n        HadoopInputSplit[] hadoopInputSplits = new HadoopInputSplit[splits.size()];\n\n        for (int i = 0; i < hadoopInputSplits.length; i++) {\n            hadoopInputSplits[i] = new HadoopInputSplit(i, splits.get(i), jobContext);\n        }\n        return hadoopInputSplits;\n    }\n\n    @Override\n    public InputSplitAssigner getInputSplitAssigner(HadoopInputSplit[] inputSplits) {\n        return new LocatableInputSplitAssigner(inputSplits);\n    }\n\n    @Override\n    public void open(HadoopInputSplit split) throws IOException {\n\n        // enforce sequential open() calls","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java#L148-L184","documentation":"Wraps an InterruptedException thrown by mapreduceInputFormat.getSplits(jobContext) during createInputSplits(), which runs on the job client / JobManager when computing input splits before scheduling. Flink re-throws the Hadoop InterruptedException as an IOException so it surfaces through the InputFormat API. It indicates split computation was interrupted, not that the input is malformed.","triggerScenarios":"Produced when HadoopInputFormatBase.createInputSplits(minNumSplits) calls the underlying Hadoop InputFormat.getSplits(jobContext) and that call throws InterruptedException — e.g. the client was cancelled during split listing, a listing of a remote filesystem (HDFS/S3) was interrupted, or the underlying InputFormat performs blocking work that got interrupted.","commonSituations":"Job submission cancelled while listing splits against a slow or remote filesystem; S3/HDFS connectivity drops during split computation; a very large directory listing interrupted by a timeout; concurrent job client shutdown.","solutions":["Inspect the causing InterruptedException in the logs to see what interrupted split computation (job cancellation, client shutdown, or an I/O timeout on the listing).","If split listing against S3/GCS is slow/flaky, retry the submission and verify filesystem connectivity and credentials.","For huge inputs, consider pre-computing splits or raising client-side timeouts rather than relying on interruptible listing.","If the job was intentionally cancelled, this is expected and can be ignored."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    hadoopInputSplits = hadoopInputFormat.createInputSplits(minSplits);\n} catch (IOException e) {\n    if (e.getCause() instanceof InterruptedException && isTransient(jobClient)) {\n        // split listing interrupted (often remote FS hiccup) — back off and retry submission\n        retrySubmissionWithBackoff();\n    } else {\n        throw e;\n    }\n}","preventionTips":["Pre-list the input to verify filesystem reachability before submission.","Ensure HDFS/S3 connectivity and credentials are valid during split computation.","Retry submission on transient remote-FS interruptions.","Avoid cancelling the client during split listing."],"tags":["hadoop","mapreduce","input-format","splits","interrupted"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}