prestodb/presto · warning · UncheckedIOException

java.io.IOException (wrapped in UncheckedIOException)

Error message

java.io.IOException (wrapped in UncheckedIOException)

What it means

ListBatchStreamReader.close registers elementStreamReader::close with a Guava Closer; if the nested element stream reader's close throws IOException, Closer rethrows it and the wrapper converts it to UncheckedIOException. This signals that closing the nested list-element reader failed — typically an underlying IO problem while finishing reads, though for most in-memory streams close failures are rare.

Source

Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/ListBatchStreamReader.java:215

        elementStreamReader.startRowGroup(dataStreamSources);
    }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .addValue(streamDescriptor)
                .toString();
    }

    @Override
    public void close()
    {
        try (Closer closer = Closer.create()) {
            closer.register(elementStreamReader::close);
        }
        catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }

    @Override
    public long getRetainedSizeInBytes()
    {
        return INSTANCE_SIZE + elementStreamReader.getRetainedSizeInBytes();
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Inspect the cause of the UncheckedIOException for the real storage-layer failure and address it (disk, network, permissions).
  2. Ensure the whole read pipeline uses try-with-resources so close failures surface in context.
  3. If close fails during exception handling, log it as suppressed rather than masking the primary error.
  4. Check the remote/filesystem health if reading from HDFS/S3; retry the read after the storage issue is resolved.

Example fix

// before
reader.close(); // UncheckedIOException surfaces raw
// after
try {
    reader.close();
}
catch (UncheckedIOException e) {
    log.warn("Failed to close ORC reader cleanly: %s", e.getCause());
    // do not let cleanup failures mask the original read error
}
Defensive patterns

Strategy: try-catch

Try / catch

try (OrcReader reader = openReader(file)) {
    return reader.readAll();
} catch (UncheckedIOException e) {
    log.warn("ORC reader close failed", e.getCause());
    throw e; // or handle storage-layer cause
}

Prevention

When it happens

Trigger: Calling close() (explicitly or via try-with-resources on the ORC page source) when elementStreamReader.close() throws IOException.

Common situations: Underlying OrcDataSource already closed or failed (disk error, remote read failure); exceptions raised during error-path cleanup (close called while handling a prior read failure); resource issues on the storage layer.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/86627ab671084e57. Report an issue: GitHub.