Skip to content

Commit

Permalink
store: Treat 'no connection to the server' as db not available
Browse files Browse the repository at this point in the history
So far we treated the Postgres error "no connection to the server" as not
indicating that the database was not available. It's a little murky what
exactly that error indicates, but it seems to indicate that an existing
connection got killed, e.g., because the database crashed.

We now treat this as an indication that the database is not available,
which will trigger the right action further up in the stack. For example,
on indexing, db operations will be retried instead of causing the subgraph
to fail. Queries will be aborted with an error message.
  • Loading branch information
lutter committed Mar 13, 2023
1 parent 8b1a524 commit 82587bd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion store/postgres/src/connection_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ impl r2d2::HandleError<r2d2::Error> for ErrorHandler {
// in a locale other than English. In that case, their database will
// be marked as unavailable even though it is perfectly fine.
if msg.contains("canceling statement")
|| msg.contains("no connection to the server")
|| msg.contains("terminating connection due to conflict with recovery")
{
return;
Expand Down

0 comments on commit 82587bd

Please sign in to comment.