{"record":{"id":"374f047afd622b3e","repo":"prestodb/presto","slug":"generic-internal-error-374f04","errorCode":"GENERIC_INTERNAL_ERROR","errorMessage":"RecordCursor was interrupted","messagePattern":"RecordCursor was interrupted","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"info","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveBucketAdapterRecordCursor.java","lineNumber":94,"sourceCode":"    public long getCompletedBytes()\n    {\n        return delegate.getCompletedBytes();\n    }\n\n    @Override\n    public Type getType(int field)\n    {\n        return delegate.getType(field);\n    }\n\n    @Override\n    public boolean advanceNextPosition()\n    {\n        while (true) {\n            if (Thread.interrupted()) {\n                // Stop processing if the query has been destroyed.\n                Thread.currentThread().interrupt();\n                throw new PrestoException(GENERIC_INTERNAL_ERROR, \"RecordCursor was interrupted\");\n            }\n\n            boolean hasNextPosition = delegate.advanceNextPosition();\n            if (!hasNextPosition) {\n                return false;\n            }\n            for (int i = 0; i < scratch.length; i++) {\n                int index = bucketColumnIndices[i];\n                if (delegate.isNull(index)) {\n                    scratch[i] = null;\n                    continue;\n                }\n                Class<?> javaType = javaTypeList.get(i);\n                if (javaType == boolean.class) {\n                    scratch[i] = delegate.getBoolean(index);\n                }\n                else if (javaType == long.class) {\n                    scratch[i] = delegate.getLong(index);","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveBucketAdapterRecordCursor.java#L76-L112","documentation":"HiveBucketAdapterRecordCursor.advanceNextPosition checks Thread.interrupted() before delegating to the underlying cursor so a destroyed/cancelled query stops promptly. If the thread is interrupted it re-sets the interrupt flag and throws GENERIC_INTERNAL_ERROR \"RecordCursor was interrupted\" — this is the expected consequence of query cancellation, not a data problem.","triggerScenarios":"The driver thread iterating the cursor is interrupted — query killed via UI/CLI, cancellation due to memory/limit/excess spill policy, session timeout — while advanceNextPosition is blocked reading the next row.","commonSituations":"Long-running Hive scans cancelled by a user or by query max-run-time; queries destroyed by the scheduler for low memory or failure of another stage; noisy-neighbor cluster kills. Seeing this in logs alongside a 'Query was canceled' is normal.","solutions":["No fix needed if the query was intentionally cancelled; treat it as expected cancellation noise.","If unexpected, check the coordinator logs for what destroyed the query (memory limit, kill command, failure in another stage).","Reduce memory pressure or increase limits (query.max-memory, memory.max-per-node) if queries are being killed automatically.","Retry the query if it was killed transiently by an external system."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    while (cursor.advanceNextPosition()) { /* consume */ }\n} catch (PrestoException e) {\n    if (\"RecordCursor was interrupted\".equals(e.getMessage())) {\n        // query was cancelled/destroyed; stop processing, no retry\n        return;\n    }\n    throw e;\n}","preventionTips":["Avoid killing queries mid-scan when possible; use query.max-run-time to bound them gracefully.","Treat this error as cancellation, not data corruption — don't retry blindly.","Monitor coordinator cancellation reasons to distinguish intentional kills from resource-based destruction."],"tags":["presto","hive","interruption","query-cancelled"],"backgroundTag":"thread-interrupted","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"}