vapor/mysql-nio

MySql 8 MySQLConnectionHandler Fatal error: unhandled packet:

oprisk opened this issue · 3 comments

MySql 8 Error:
MySQLNIO/MySQLConnectionHandler.swift:89: Fatal error: unhandled packet: ByteBuffer ......

Xcode running the Vapor server and after about 12 hours, overnight, without connection activity, crashes with the above error message. See the attached error message snippet.

To Reproduce

The vapor server connected to LAN MySql 8 server on Mac OSX 12.6,
OSX Vapor server:
image
MySql 8 server
image
image

Xcode running the Vapor server and after about 12 hours, overnight, without connection activity, crashes with the above error message. See the attached error message snippet.

see attached snippets

Steps to reproduce the behavior:

  1. Add package with configuration '...'
  2. Send request with options '...'
  3. See error

Expected behavior

A clear and concise description of what you expected to happen.
The MySql 8 server is running continuously. The vapor app connects as necessary to the MySql 8 server, residing in another osx server on the same network (subnet). After maybe 12 hours, overnight, the Vapor server crashes with the above error.

  1. My suspicion is that the vapor connection should be released after a timeout (maybe 30min).
  2. Is the Vapor Server receiving a query from the MySql 8 server?
  3. Is there an issue if MySql 8 server is inactive for 12 hours?

Environment

There is nothing special about the environment, standard, only setting is the working directory.

image

  • Vapor Framework version: 4.69.2
  • Vapor Toolbox version:
  • OS version: Ventura 13.3
    Apple MacStudio
    M1 Max

Additional context

Add any other context about the problem here.
MySql 8 ConnectionHandler Error

Additional info pertaining to the error:
image

A quick decode of the raw packet bytes from the unhandled packet shows it to be an ERR_Packet with the message that the client was disconnected due to idle timeout* (exceeded the length of the server's wait_timeout setting, which defaults to 8 hours). This is a known issue with MySQLNIO's connection handling and will be addressed by the code rewrite currently in progress.

* The error packet contained error code 0xfbf (4031) ER_CLIENT_INTERACTION_TIMEOUT, SQL state #HY000, and the message:

The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.

This is a duplicate of #87; the final fix will be tracked there