Skip to content

Commit

Permalink
Fix connection error message regexp for Mysql2
Browse files Browse the repository at this point in the history
In CI, sometimes the Mysql2 error message for a lost connection doesn't
include "MySQL server", it says "Lost connection to server".
This commit makes the "MySQL" part of the regexp optional.

Co-authored-by: Nikita Vasilevsky <nikita.vasilevsky@shopify.com>
  • Loading branch information
adrianna-chang-shopify and nvasilevski committed Oct 26, 2023
1 parent 1eab2e5 commit 510978d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/semian/mysql2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module Mysql2
include Semian::Adapter

CONNECTION_ERROR = Regexp.union(
/Can't connect to MySQL server on/i,
/Lost connection to MySQL server/i,
/Can't connect to (?:MySQL )?server on/i,
/Lost connection to (?:MySQL )?server/i,
/MySQL server has gone away/i,
/Too many connections/i,
/closed MySQL connection/i,
Expand Down

0 comments on commit 510978d

Please sign in to comment.