nlf/connect-mysql — pull request #20 by mjeffery (2014-01-08 18:11:53+00:00)
Title: Explicit disconnect handling on connection pools

Update to the node-mysql@2.x compatibility to resolve an issue with the pool connections being terminated by the database. The system now captures `PROTOCOL_CONNECTION_LOST` errors and attempts to retry the connection up to `retries` times before reporting an error to the controlling session middleware.

This required a rewrite to push most errors back to the session middleware callbacks. Transport failures on connect like `ENOTFOUND` or `EADDRINUSE` are still thrown as uncaught exceptions, as node-mysql does not capture them.

This patch seems to have worked, but I didn't use a test suite to verify.