Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Today the connector has no client-side control over packet size: the handshake max_packet_size field is hardcoded to 1 GB, and the outgoing/incoming limits are driven only by the server's max_allowed_packet.
Add a maxAllowedPacket connection option that:
- caps the maximum size of packets the driver will send;
- caps the maximum size of packets the driver will accept when reading.
Received packets are size-checked in two phases:
- Before authentication: a fixed 1 Mb cap.
- After authentication:
- if maxAllowedPacket is set, then that value is honored
- if unset, then a server-independent heap-relative ceiling: a quarter of the JVM max heap, clamped between 16 Mb and 1 Gb.