Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle DB failures better #2305

Open
RhinosF1 opened this issue Jun 11, 2022 · 4 comments
Open

Handle DB failures better #2305

RhinosF1 opened this issue Jun 11, 2022 · 4 comments
Labels
Bug Things to squish; generally used for issues Needs Triage Issues that need to be reviewed and categorized

Comments

@RhinosF1
Copy link
Contributor

Description

Sopel should be able to degrade to handle short database issues better

  • don't throw exceptions when read only. Writes from things like seen could be thrown away or you could store in memory to run when back available
  • Be able to use a replica if the DB is unavailable for some reason.

Reproduction steps

  1. Setup sopel with MariaDB
  2. Blow MariaDB up by putting in RO or shutting it down
  3. See exceptions and issues

Expected behavior

Sopel attempts to do as much as possible

Relevant logs

11:04:56 <MirahezeBotBeta> [2022-06-11 10:04:55,747] sopel.bot            ERROR    - Unexpected error ((MySQLdb._exceptions.OperationalError) (1290, 'The MariaDB server is running with the --read-only option so it cannot execute this statement') [SQL: UPDATE nick_values SET value=%s WHERE nick_values.nick_id = %s AND nick_values.`key` = %s] [parameters: ('1654941895.595715', 579, 'seen_timestamp')] (Background on this error at: https://sqlalche.me/e/14

Notes

No response

Sopel version

master

Installation method

./setup.py install

Python version

3.9.2

Operating system

Debian Bullseye

IRCd

Libera

Relevant plugins

seen

@RhinosF1 RhinosF1 added Bug Things to squish; generally used for issues Needs Triage Issues that need to be reviewed and categorized labels Jun 11, 2022
@half-duplex
Copy link
Member

Same thing when the disk fills up and sqlite errors. It sends a huge error message after every single IRC message, spamming the hell out of its channels.

@RustyBower RustyBower self-assigned this Jul 18, 2022
SnoopJ added a commit to SnoopJ/sopel that referenced this issue Aug 6, 2022
SnoopJ added a commit to SnoopJ/sopel that referenced this issue Aug 6, 2022
SnoopJ added a commit to SnoopJ/sopel that referenced this issue Aug 6, 2022
SnoopJ added a commit to SnoopJ/sopel that referenced this issue Sep 3, 2022
Co-authored-by: Florian Strzelecki <florian.strzelecki@gmail.com>
@SnoopJ
Copy link
Contributor

SnoopJ commented Jun 9, 2023

Sopel should degrade more gracefully with the changes in #2338, closing.

@dgw
Copy link
Member

dgw commented Jun 9, 2023

I was going to unassign Rusty at some point no matter what, since he's generally too busy to work on this stuff these days. But are you sure about closing this, @SnoopJ? The linked PR only addresses seen, not the overall bot.db object. 🤔

@SnoopJ
Copy link
Contributor

SnoopJ commented Jun 9, 2023

Hmm, that's a good point, it should stay open after all. Sorry for the noise 😬

@SnoopJ SnoopJ reopened this Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Things to squish; generally used for issues Needs Triage Issues that need to be reviewed and categorized
Projects
None yet
Development

No branches or pull requests

5 participants