{"record":{"id":"0fa9667754a6df03","repo":"apache/beam","slug":"error-determining-if-s-allows-dynamic-splitting","errorCode":null,"errorMessage":"Error determining if %s allows dynamic splitting","messagePattern":"Error determining if (.+?) allows dynamic splitting","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java","lineNumber":562,"sourceCode":"\n    /**\n     * Closes any {@link ReadableByteChannel} created for the current reader. This implementation is\n     * idempotent. Any {@code close()} method introduced by a subclass must be idempotent and must\n     * call the {@code close()} method in the {@code FileBasedReader}.\n     */\n    @Override\n    public void close() throws IOException {\n      if (channel != null) {\n        channel.close();\n      }\n    }\n\n    @Override\n    public boolean allowsDynamicSplitting() {\n      try {\n        return getCurrentSource().isSplittable();\n      } catch (Exception e) {\n        throw new RuntimeException(\n            String.format(\"Error determining if %s allows dynamic splitting\", this), e);\n      }\n    }\n\n    /**\n     * Performs any initialization of the subclass of {@code FileBasedReader} that involves IO\n     * operations. Will only be invoked once and before that invocation the base class will seek the\n     * channel to the source's starting offset.\n     *\n     * <p>Provided {@link ReadableByteChannel} is for the file represented by the source of this\n     * reader. Subclass may use the {@code channel} to build a higher level IO abstraction, e.g., a\n     * BufferedReader or an XML parser.\n     *\n     * <p>If the corresponding source is for a subrange of a file, {@code channel} is guaranteed to\n     * be an instance of the type {@link SeekableByteChannel}.\n     *\n     * <p>After this method is invoked the base class will not be reading data from the channel or\n     * adjusting the position of the channel. But the base class is responsible for properly closing","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java#L544-L580","documentation":"FileBasedReader.allowsDynamicSplitting() wraps any exception from getCurrentSource().isSplittable() into a RuntimeException 'Error determining if %s allows dynamic splitting'. It indicates the reader could not query its source's splittability — usually a filesystem/IO failure while resolving the current source.","triggerScenarios":"isSplittable() throwing during dynamic work rebalancing — underlying filesystem errors (metadata lookup failing), source in a bad state after read errors, or runner-driven split attempts during IO instability.","commonSituations":"Runner attempts dynamic splitting while the backing file/pattern is temporarily unavailable (GCS 5xx, HDFS namenode issues), or custom FileBasedSource.isSplittable() implementations that throw.","solutions":["Inspect the chained cause for the underlying IO error and fix storage connectivity.","Retry the pipeline; transient storage failures often resolve.","If you implemented a custom FileBasedSource, make isSplittable() not throw.","Disable/avoid dynamic splitting scenarios by reading bounded, well-formed file patterns."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { reader.allowsDynamicSplitting(); } catch (RuntimeException e) { log.warn(\"Splittability check failed for {}\", e.getCause(), e); }","preventionTips":["Verify file patterns resolve before pipeline launch.","For custom sources, make isSplittable() side-effect free and non-throwing.","Watch storage error rates during jobs with heavy dynamic splitting."],"tags":["java","apache-beam","io","dynamic-splitting"],"backgroundTag":"file-read-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}