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 client errors on appview #1481

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Handle db client errors on appview #1481

merged 1 commit into from
Aug 16, 2023

Conversation

devinivy
Copy link
Collaborator

Avoids potential crash on certain kinds of connection errors on appview.

@@ -83,3 +85,5 @@ export class Database {
}

export default Database

const onClientError = (err: Error) => dbLogger.error({ err }, 'db client error')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we close the connection here? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my initial reaction too— I had a client.release(err) in there to drop the connection from the pool and close it. But it turns out kysely also has its hands in there, and I was getting a double-release error from the pool which caused its own unhandled error 🙃 I think we should keep an eye on it, but hoping this is good enough for now with the work that the pool and kysely are also doing.

Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup yup 👍

@devinivy devinivy merged commit 8eb9303 into main Aug 16, 2023
@devinivy devinivy deleted the db-client-err branch August 16, 2023 18:02
estrattonbailey pushed a commit that referenced this pull request Aug 17, 2023
handle db client errors on bav
estrattonbailey added a commit that referenced this pull request Aug 17, 2023
…lies

* origin:
  Increase CI test matrix size (#1490)
  Fix condition for viewing soft-deleted followers (#1485)
  ✨ Expose takendown profile, their follows and followers to mods (#1456)
  Handle revalidation (#1474)
  Handle db pool errors on appview (#1483)
  Handle db client errors on appview (#1481)
estrattonbailey added a commit that referenced this pull request Aug 18, 2023
* origin: (21 commits)
  styleguide
  Increase CI test matrix size (#1490)
  tweak author-feed rejects test syntax
  update test
  format
  add repost of reply, update snaps
  simplify query
  fix typos
  include reposted replies in posts_no_replies filter
  fix bad test syntax
  fix actor takedown tests
  use getActor, failing atm
  only include media posts by post creator
  Fix condition for viewing soft-deleted followers (#1485)
  ✨ Expose takendown profile, their follows and followers to mods (#1456)
  Handle revalidation (#1474)
  Handle db pool errors on appview (#1483)
  Handle db client errors on appview (#1481)
  v0.6.4
  ✨ Allow creating moderation action with a duration (#1431)
  ...
mloar pushed a commit to mloar/atproto that referenced this pull request Sep 26, 2023
mloar pushed a commit to mloar/atproto that referenced this pull request Nov 15, 2023
mloar pushed a commit to mloar/atproto that referenced this pull request Nov 15, 2023
…lies

* origin:
  Increase CI test matrix size (bluesky-social#1490)
  Fix condition for viewing soft-deleted followers (bluesky-social#1485)
  ✨ Expose takendown profile, their follows and followers to mods (bluesky-social#1456)
  Handle revalidation (bluesky-social#1474)
  Handle db pool errors on appview (bluesky-social#1483)
  Handle db client errors on appview (bluesky-social#1481)
mloar pushed a commit to mloar/atproto that referenced this pull request Nov 15, 2023
* origin: (21 commits)
  styleguide
  Increase CI test matrix size (bluesky-social#1490)
  tweak author-feed rejects test syntax
  update test
  format
  add repost of reply, update snaps
  simplify query
  fix typos
  include reposted replies in posts_no_replies filter
  fix bad test syntax
  fix actor takedown tests
  use getActor, failing atm
  only include media posts by post creator
  Fix condition for viewing soft-deleted followers (bluesky-social#1485)
  ✨ Expose takendown profile, their follows and followers to mods (bluesky-social#1456)
  Handle revalidation (bluesky-social#1474)
  Handle db pool errors on appview (bluesky-social#1483)
  Handle db client errors on appview (bluesky-social#1481)
  v0.6.4
  ✨ Allow creating moderation action with a duration (bluesky-social#1431)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants