GitHub

Three bugs in the Go MySQL Driver

May 21, 2020Vicent Martí
Three bugs in the Go MySQL Driver
SummaryAI, from the source post

This post details the identification and upstream fix for the 'Invalid connection (unexpected EOF)' bug in the Go MySQL driver. It explains how server-side idle timeouts combined with the MySQL wire protocol's client-managed command phase can lead to the server closing a connection without the client being immediately aware. The post also discusses why returning `driver.ErrBadConn` is not always safe for certain operations (like UPDATEs) and explores workarounds and the eventual introduction of `SessionResetter` as a solution.