Page MenuHomeDevCentral

Allow to reconnect automatically to MariaDB
Open, HighPublic

Description

18:38:15 < Dereckson> [complector] Deploy autochmod-git fix (D3996)
18:38:20 < Dereckson> .+log [Complector] Deploy autochmod-git fix (D3996)

Only the second expression worked. When debugging why, it showed MariaDB connection was out, after a tunnel interface update:

18:44:49 <Dereckson> .tcl could_be_a_component Complector
18:44:49 <Wearg> Tcl error: Error 2006 (Server has gone away)

There is an opportunity to automatically remediate to that situation in registry command to detect that case and reconnect automatically using <code>sqlrehash</code> to retry once.

Plan:

  • Replace sql by a new safesql command in registry procedure
  • Define safesql command as a sql command wrapped in a catch block, to detect the case server has been disconnected and reconnect in that case before retry (once)
  • Could also be interesting to report any other MySQL/MariaDB reconnection error to Sentry.

Event Timeline

dereckson triaged this task as High priority.Sat, Mar 21, 09:22
dereckson created this task.

As the eggdrop code supports to run a function periodically with bind time with a syntax similar to cron, it could be interesting too to check server connections health there too.

TIME (stackable)

bind time <flags> <mask> <proc>

procname <minute 00-59> <hour 00-23> <day 01-31> <month 00-11> <year 0000-9999>

Description: allows you to schedule procedure calls at certain times. mask matches 5 space separated integers of the form: “minute hour day month year”. The month var starts at 00 (Jan) and ends at 11 (Dec). Minute, hour, day, month have a zero padding so they are exactly two characters long; year is four characters. Flags are ignored.

Module: core