Support packet sequence wrong error
In I484237c28a83783689bb8484152476de33f20e3a, we observed MariaDB-specific error code 1927 as a new kind of disconnect situation. In some failure-mode testing we are also observing with PyMySQL that a stale connection, when it is attempted to be used for the initial ping, does not return any error code but instead trips up PyMySQL with packets sequence numbers (this is an internal value used by the MySQL client/server protocol to track messages). The connection is definitely not recoverable in this state so this also needs to be a disconnect situation so that the ping listener refreshes the connection pool. Change-Id: Iee1c4533e2457acc30e2046b63145c2502012c5f References: https://bugs.launchpad.net/tripleo/+bug/1642944
This commit is contained in:
@@ -387,6 +387,7 @@ def _raise_operational_errors_directly_filter(operational_error,
|
||||
|
||||
@filters("mysql", sqla_exc.OperationalError, r".*\(.*(?:2002|2003|2006|2013|1047)") # noqa
|
||||
@filters("mysql", sqla_exc.InternalError, r".*\(.*(?:1927)") # noqa
|
||||
@filters("mysql", sqla_exc.InternalError, r".*Packet sequence number wrong") # noqa
|
||||
@filters("postgresql", sqla_exc.OperationalError, r".*could not connect to server") # noqa
|
||||
@filters("ibm_db_sa", sqla_exc.OperationalError, r".*(?:30081)")
|
||||
def _is_db_connection_error(operational_error, match, engine_name,
|
||||
|
||||
@@ -1195,6 +1195,14 @@ class TestDBDisconnected(TestsExceptionFilter):
|
||||
is_disconnect=False
|
||||
)
|
||||
|
||||
def test_packet_sequence_wrong_error(self):
|
||||
self._test_ping_listener_disconnected(
|
||||
"mysql",
|
||||
self.InternalError(
|
||||
'Packet sequence number wrong - got 35 expected 1'),
|
||||
is_disconnect=False
|
||||
)
|
||||
|
||||
def test_mysql_ping_listener_disconnected(self):
|
||||
for code in [2006, 2013, 2014, 2045, 2055]:
|
||||
self._test_ping_listener_disconnected(
|
||||
|
||||
Reference in New Issue
Block a user