public inbox for [email protected]
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: "GNU/Weeb Mailing List" <[email protected]>,
	Muhammad Rizki <[email protected]>
Subject: Re: [PATCH RESEND v3 1/2] daemon: telegram: db: Allow the caller to reconnect
Date: Mon, 31 Oct 2022 23:25:40 +0700	[thread overview]
Message-ID: <CAOG64qOz7JLi2uDh9=5Tivo41nef2w7pFYhx5S1NCaw61-kVwg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>

On Mon, Oct 31, 2022 at 11:13 PM Ammar Faizi wrote:
> The daemon is totally unusable when the MySQL server is restarted. It's
> spinning in a loop with the following error:
>
>    mysql.connector.errors.OperationalError: 2013 (HY000): Lost connection to MySQL server during query
>
> When it happens, the only way to fix the situation is: restart the
> daemon manually, which is obviously not productive. Create a mechanism
> in the class DB to allow the caller to reconnect. This way, the caller
> can automatically reconnect without having the user restart the daemon.
>
> v2:
>   - Use conn.ping(reconnect=True) instead of creating a new MySQL
>     connection object (comment from Muhammad Rizki).
>
> Signed-off-by: Ammar Faizi <[email protected]>

Reviewed-by: Alviro Iskandar Setiawan <[email protected]>

  reply	other threads:[~2022-10-31 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 16:12 [PATCH RESEND v3 0/2] Automatic recovery from a MySQL restart Ammar Faizi
2022-10-31 16:12 ` [PATCH RESEND v3 1/2] daemon: telegram: db: Allow the caller to reconnect Ammar Faizi
2022-10-31 16:25   ` Alviro Iskandar Setiawan [this message]
2022-10-31 16:29   ` Muhammad Rizki
2022-10-31 16:12 ` [PATCH RESEND v3 2/2] daemon: telegram: Handle MySQL error Ammar Faizi
2022-10-31 16:26   ` Alviro Iskandar Setiawan
2022-10-31 16:34   ` Muhammad Rizki
2022-10-31 16:38     ` [PATCH RESEND v3 0/2] Automatic recovery from a MySQL restart Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOG64qOz7JLi2uDh9=5Tivo41nef2w7pFYhx5S1NCaw61-kVwg@mail.gmail.com' \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox