-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PostgREST does not log 503 errors to stderr #3841
Comments
This not only happens on read replicas but also on connections to a single primary db.
I missed this issue #3673, this is tracked there. The solution seems simple enough. It would need to also log for postgrest/src/PostgREST/AppState.hs Lines 268 to 273 in e7cc8fe
Something like: SQL.SessionUsageError (SQL.QueryError _ _ (SQL.ClientError _)) ->
when (Error.status (Error.PgError False err) >= HTTP.status500) $
observer $ QueryErrorCodeHighObs err
) I don't remember if there's a reason why we don't log on |
@laurenceisla Hm, I can't see this. Any ideas on how to reproduce this error in our tests using |
Yeah, I don't think that's gonna be easy or possible to reproduce in replicas. But this also happens for regular connections too, so you should test in One way to trigger a |
This looks like a bug fix to me, as the "crit" level should document all critical error messages as documented. Sidenote: Just noticed that we don't have a "bug" label anymore, and there's a "Type: bug" field on github. It looks like all our "bug" issues have been migrated to that type. That was confusing. |
👋 That was me ;) |
Environment
Description of issue
PostgREST logged the following (requests queries redacted):
As seen above it does not log the 503 error (when it should) and retries connection immediately. For instance, the 500 errors are logged correctly:
Now, checking the PostgreSQL logs, it shows that it's an error related to. In particular, it shows these two errors:
Not sure if PostgREST should try to reconnect or not in these cases, since a solution is to set
max_standby_archive_delay
andmax_standby_streaming_delay
in PG config to avoid the error.The text was updated successfully, but these errors were encountered: