Skip to content

Java MariaDB JDBC socket error with ProxySQL: unexpected end of stream / Unexpected packet from client during Hibernate update flow #5930

Description

@balajibabu-eng

Hi Team,

We are facing intermittent Java/JDBC socket errors after routing application traffic through ProxySQL.

Environment:

  • ProxySQL version: 3.0.8-481-g0ef544c
  • OS: Ubuntu 24.04
  • Backend DB: MariaDB 11.8.6
  • JDBC driver: org.mariadb.jdbc.Driver
  • Application framework: Spring Boot / Hibernate / HikariCP
  • Topology: Application -> Load Balancer -> ProxySQL -> MariaDB
  • ProxySQL frontend port: 6033
  • Backend writer hostgroup: 10
  • Reader hostgroup: 20
  • mysql-multiplexing: true
  • mysql-enable_server_deprecate_eof: true
  • Application uses Hibernate batching: yes

Issue:
After routing Java application traffic through ProxySQL, normal DB connectivity works, and simple SELECT/INSERT/UPDATE queries succeed. However, during application create/update flows, the application intermittently fails with JDBC socket errors.

Application-side error:

java.sql.SQLNonTransientConnectionException: Socket error

Caused by:

java.io.EOFException: unexpected end of stream, read 0 bytes from 4 (socket was closed by server)

ProxySQL log shows:

MySQL_Session.cpp:4808:handler___status_NONE_or_default(): [ERROR] Unexpected packet from client <app_client_ip>. Session_status: 6 , client_status: 0 Disconnecting it

Also:

MySQL_Thread.cpp:4398:ProcessAllSessions_Healthy0(): [WARNING] Closing unhealthy client connection <app_client_ip>:

Validation already done:

  1. Direct connection to ProxySQL frontend works.
  2. SELECT through ProxySQL works.
  3. INSERT through ProxySQL works.
  4. UPDATE through ProxySQL works.
  5. Transaction + rollback through ProxySQL works.
  6. Same DB-level tests through Load Balancer -> ProxySQL also work.
  7. ProxySQL monitor logs show backend servers healthy.
  8. No backend MariaDB connection errors during simple DB tests.

The issue appears only during full Java/Hibernate application flows, especially create/update order operations.

Question:
Is this a known issue with ProxySQL multiplexing and Java/Hibernate/MariaDB JDBC batching?
Is disabling multiplexing for the affected application user the recommended approach, or should Hibernate batching be disabled instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions