MyCATApache/Mycat-Server · error · RuntimeException

offer data error!

Error message

offer data error!

What it means

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!").

Solutions

  1. Increase processor queue size / processor count in server.xml to reduce executor rejection under load
  2. Find the slow consumer (stuck session, huge unbuffered result set) causing queue backlog and fix or kill it
  3. Ensure backend connections are closed gracefully on shutdown to avoid packets hitting dead executors
  4. Retry the operation — the error is typically transient overload
Defensive patterns

Strategy: try-catch

Try / catch

try { session.execute(...); } catch (RuntimeException e) { if ("offer data error!".equals(e.getMessage())) { session.close(); /* retry later / new connection */ } else { throw e; } }

Prevention

When it happens

Trigger: 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.

Common situations: High load with saturated MyCat NIO processor queues, a slow/stuck frontend consumer, executor rejection during MyCat shutdown while PG connections still deliver data.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of MyCATApache/Mycat-Server@65f8d8beb7 (2026-09-11). Data as JSON: /api/errors/e7c1bac79fa826d2. Report an issue: GitHub.

Appendix: source

Thrown at src/main/java/io/mycat/backend/postgresql/PostgreSQLBackendConnectionHandler.java:422

			default:
				LOGGER.warn("not handled connecton state  err "
						+ source.getState() + " for con " + source);
				break;

			}
		} catch (Exception e) {
			LOGGER.error("读取数据包出错",e);
		}finally{
			if(theBuf!=null){
				source.recycle(theBuf);
			}
		}
	}

	@Override
	protected void offerDataError() {
		resultStatus = RESULT_STATUS_INIT;
		throw new RuntimeException("offer data error!");
	}

}

View on GitHub (pinned to 65f8d8beb7)