knex: Reconnect to mysql on disconnect or error

If the MySQL server goes down, or it down scales or something the previous connection of the application server with MySQL get corrupted and the server starts throwing this issue PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR Cannot enqueue Query after fatal error We face multiple errors in such scenarios, In the docs, I couldn’t find anything regarding reconnecting the only solution that we have is restarting the service?

I would like to know that, do you have anything like reconnectTries, reconnectInterval like other libraries like this mongo library has

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 19 (5 by maintainers)

Most upvoted comments

@treble-snake I’m fixing some new pool problems to 0.14.1

@ammar08429 I’d suggest you use 0.13.0 version for now, it seems more stable

Simple restart is working right now