{"record":{"id":"f1452e8af0c8cb49","repo":"prestodb/presto","slug":"atop-read-timeout","errorCode":"ATOP_READ_TIMEOUT","errorMessage":"Timeout reading from atop process","messagePattern":"Timeout reading from atop process","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-atop/src/main/java/com/facebook/presto/atop/AtopProcessFactory.java","lineNumber":112,"sourceCode":"\n        private AtopProcess(Process process, Duration readTimeout, ExecutorService executor)\n        {\n            this.process = requireNonNull(process, \"process is null\");\n            underlyingReader = new BufferedReader(new InputStreamReader(process.getInputStream()));\n            TimeLimiter limiter = SimpleTimeLimiter.create(executor);\n            this.reader = limiter.newProxy(underlyingReader::readLine, LineReader.class, readTimeout.toMillis(), MILLISECONDS);\n            try {\n                // Ignore the first two lines, as they are an event since boot (RESET followed by event line)\n                this.reader.readLine();\n                this.reader.readLine();\n                // Read the first real line\n                line = this.reader.readLine();\n            }\n            catch (IOException e) {\n                line = null;\n            }\n            catch (UncheckedTimeoutException e) {\n                throw new PrestoException(ATOP_READ_TIMEOUT, \"Timeout reading from atop process\");\n            }\n        }\n\n        @Override\n        public boolean hasNext()\n        {\n            return line != null;\n        }\n\n        @Override\n        public String next()\n        {\n            if (line == null) {\n                throw new NoSuchElementException();\n            }\n            String currentLine = line;\n            try {\n                line = reader.readLine();","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-atop/src/main/java/com/facebook/presto/atop/AtopProcessFactory.java#L94-L130","documentation":"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.","triggerScenarios":"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.","commonSituations":"Querying long atop history ranges on busy nodes; undersized executors; read-timeout configured too low for the environment.","solutions":["Increase the read-timeout property in the atop catalog configuration","Reduce the queried time range / history depth per query","Check node load and atop health (run the command manually); restart or fix atop on that host"],"exampleFix":"// before\natop.read-timeout=5s\n// after\natop.read-timeout=30s","handlingStrategy":"retry","validationCode":"// Sanity-check the atop process responds quickly before large scans\nProcess p = new ProcessBuilder(\"timeout\", \"5\", \"atop\", \"-r\", \"yesterday\").start();\n// nonzero/timeout exit means atop is too slow — fail fast or widen timeout","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Configure a read-timeout appropriate for node load","Limit query time ranges over atop history","Monitor host load; atop reads can stall on overloaded nodes"],"tags":["atop","timeout","process-execution"],"backgroundTag":"process-read-timeout","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}