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

fix panic with generic error #21

Merged
merged 7 commits into from
Mar 13, 2024
Merged

fix panic with generic error #21

merged 7 commits into from
Mar 13, 2024

Conversation

diogob
Copy link
Owner

@diogob diogob commented Mar 12, 2024

This refers to #20

  • When PQ.socket fails we just need to wait, the connection should be starting or resetting
  • Panic and try to get libpq message when consumeInput fails
  • Reformat

@steve-chavez
Copy link

steve-chavez commented Mar 12, 2024

Thanks a lot for the quick fix @diogob.

I'm already seeing a more informative error message with this change:

12/Mar/2024:17:41:57 -0500: FatalError {fatalErrorMessage = "\"server closed the connection unexpectedly\\n\\tThis probably means the server terminated abnormally\\n\\tbefore or while pro
cessing the request.\\n\""}. Retrying listening for notifications on the pgrst channel..

This when terminating the pg connection manually with:

select pg_terminate_backend(pid) from pg_stat_activity where application_name ilike '%postgrest%' and query ilike '%listen%';

Would it be possible to unwrap the error message? Perhaps by exporting FatalError? No problem if not. Otherwise the PR looks good to me 👍

@diogob
Copy link
Owner Author

diogob commented Mar 13, 2024

@steve-chavez could you test again? I have exported FatalError for testing but also have added a new show instance that should give you a neater interface to the error message.

@steve-chavez
Copy link

@diogob Looks great!

13/Mar/2024:09:59:25 -0500: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

Also, exporting FatalError is no longer necessary now that there's instance Show FatalError 👍

@diogob diogob merged commit 3ce8a20 into master Mar 13, 2024
1 check passed
@diogob diogob deleted the fix-panic-with-generic-error branch March 13, 2024 15:34
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