prestodb/presto · error · PrestoException

ATOP_READ_TIMEOUT

ATOP_READ_TIMEOUT

Error message

Timeout reading from atop process

What it means

AtopProcess's iterator reads lines from the running atop process with a read timeout. If readLine() exceeds the timeout, the UncheckedTimeoutException is converted into a PrestoException ATOP_READ_TIMEOUT, aborting the scan rather than hanging forever.

Source

Thrown at presto-atop/src/main/java/com/facebook/presto/atop/AtopProcessFactory.java:112

        private AtopProcess(Process process, Duration readTimeout, ExecutorService executor)
        {
            this.process = requireNonNull(process, "process is null");
            underlyingReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            TimeLimiter limiter = SimpleTimeLimiter.create(executor);
            this.reader = limiter.newProxy(underlyingReader::readLine, LineReader.class, readTimeout.toMillis(), MILLISECONDS);
            try {
                // Ignore the first two lines, as they are an event since boot (RESET followed by event line)
                this.reader.readLine();
                this.reader.readLine();
                // Read the first real line
                line = this.reader.readLine();
            }
            catch (IOException e) {
                line = null;
            }
            catch (UncheckedTimeoutException e) {
                throw new PrestoException(ATOP_READ_TIMEOUT, "Timeout reading from atop process");
            }
        }

        @Override
        public boolean hasNext()
        {
            return line != null;
        }

        @Override
        public String next()
        {
            if (line == null) {
                throw new NoSuchElementException();
            }
            String currentLine = line;
            try {
                line = reader.readLine();

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Increase the read-timeout property in the atop catalog configuration
  2. Reduce the queried time range / history depth per query
  3. Check node load and atop health (run the command manually); restart or fix atop on that host

Example fix

// before
atop.read-timeout=5s
// after
atop.read-timeout=30s
Defensive patterns

Strategy: retry

Validate before calling

// Sanity-check the atop process responds quickly before large scans
Process p = new ProcessBuilder("timeout", "5", "atop", "-r", "yesterday").start();
// nonzero/timeout exit means atop is too slow — fail fast or widen timeout

Try / catch

try { /* read atop output */ } catch (PrestoException e) { if (e.getErrorCode().getName().equals("ATOP_READ_TIMEOUT")) { /* retry with smaller range or after increasing read-timeout */ } throw e; }

Prevention

When it happens

Trigger: The atop process is slow or wedged (huge history window, overloaded host, slow disk) so a read exceeds the configured read-timeout; atop hangs waiting on the system.

Common situations: Querying long atop history ranges on busy nodes; undersized executors; read-timeout configured too low for the environment.

Understand the failure class

Related errors


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