vapor / mysql-nio

🐬 Non-blocking, event-driven Swift client for MySQL.
MIT License
91 stars 26 forks source link

MySql 8 MySQLConnectionHandler Fatal error: unhandled packet: #89

Closed oprisk closed 1 year ago

oprisk commented 1 year ago

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

Additional context

Add any other context about the problem here.

MySql 8 ConnectionHandler Error
oprisk commented 1 year ago

Additional info pertaining to the error: image

gwynne commented 1 year ago

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.

gwynne commented 1 year ago

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