{"record":{"id":"e7c1bac79fa826d2","repo":"MyCATApache/Mycat-Server","slug":"offer-data-error-e7c1ba","errorCode":null,"errorMessage":"offer data error!","messagePattern":"offer data error!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/backend/postgresql/PostgreSQLBackendConnectionHandler.java","lineNumber":422,"sourceCode":"\t\t\tdefault:\n\t\t\t\tLOGGER.warn(\"not handled connecton state  err \"\n\t\t\t\t\t\t+ source.getState() + \" for con \" + source);\n\t\t\t\tbreak;\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"读取数据包出错\",e);\n\t\t}finally{\n\t\t\tif(theBuf!=null){\n\t\t\t\tsource.recycle(theBuf);\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tprotected void offerDataError() {\n\t\tresultStatus = RESULT_STATUS_INIT;\n\t\tthrow new RuntimeException(\"offer data error!\");\n\t}\n\n}\n","sourceCodeStart":404,"sourceCodeEnd":426,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/backend/postgresql/PostgreSQLBackendConnectionHandler.java#L404-L426","documentation":"PostgreSQLBackendConnectionHandler (a NIO packet handler) enqueues incoming backend packets via offerData() onto the processor executor. When the executor queue rejects the task (full or shut down), offerDataError() resets resultStatus to RESULT_STATUS_INIT and throws RuntimeException(\"offer data error!\").","triggerScenarios":"The NIO processor's task queue for this PG backend connection is full or its executor is shut down while packets (DataRow/CommandComplete etc.) continue arriving from the PostgreSQL server.","commonSituations":"High load with saturated MyCat NIO processor queues, a slow/stuck frontend consumer, executor rejection during MyCat shutdown while PG connections still deliver data.","solutions":["Increase processor queue size / processor count in server.xml to reduce executor rejection under load","Find the slow consumer (stuck session, huge unbuffered result set) causing queue backlog and fix or kill it","Ensure backend connections are closed gracefully on shutdown to avoid packets hitting dead executors","Retry the operation — the error is typically transient overload"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { session.execute(...); } catch (RuntimeException e) { if (\"offer data error!\".equals(e.getMessage())) { session.close(); /* retry later / new connection */ } else { throw e; } }","preventionTips":["Tune NIO processor queue sizes for PG result-set bursts","Kill stuck frontend sessions causing backlog","Close PG backend connections gracefully on shutdown"],"tags":["postgresql","nio","executor","backpressure"],"backgroundTag":"internal-invariant-violation","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}