-
-
Notifications
You must be signed in to change notification settings - Fork 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
feat: add db-pool-automatic-recovery configuration to disable connection retrying #2900
Conversation
@steve-chavez Also, I am thinking maybe we should call the configuration option |
@taimoorzaeem Since recovery is a feature of the connection pool, how about calling it Note that all our pool configs have the db-pool prefix. |
4a6132b
to
bd5e361
Compare
@taimoorzaeem Hm, I would expect the disable to work in this case:
But it still recovers:
For this I think we can catch the exception here and also kill the main thread: postgrest/src/PostgREST/AppState.hs Lines 144 to 150 in 87d6a0d
Is the env var not getting applied? I've tried:
The new config is missing from: postgrest/src/PostgREST/CLI.hs Lines 124 to 166 in 87d6a0d
Here's an example of how configs are modified per io test: Lines 1056 to 1061 in 87d6a0d
Here's an example that catches the exit code: Lines 69 to 75 in 87d6a0d
Might be possible to have an io test based on those |
bd5e361
to
772aa58
Compare
@steve-chavez This didn't work. Alternatively, I handled that in |
The static build is failing, maybe related to #2905? Rebasing with the main branch should fix this. |
772aa58
to
3d5c5b7
Compare
@steve-chavez @laurenceisla I was thinking of adding a test case for |
@taimoorzaeem Yes, that's possible. There are some examples on postgrest/test/io/fixtures.sql Lines 118 to 123 in 32b77ca
Lines 853 to 857 in 32b77ca
|
3d5c5b7
to
ef61f81
Compare
@steve-chavez I have tried doing the above in the latest push, however calling such an |
ef61f81
to
de4e14c
Compare
@taimoorzaeem Nice work! How about documenting this new config on: |
Sure! I would love to. :) |
Thank you all for the effort to make it happen! Really appreciate it! Kindly ask do you know in which version will this feature be included and released? |
@yaobinwen-mvs Cheers! Most likely, we will have this feature in our next release which would be |
@taimoorzaeem Cool! Thanks! Do you know when the new version would be released? (I looked around in the repository but didn't seem to find any document about the release schedule.) |
@yaobinwen-mvs We'll make a new release once we fix #2846, which should be completed in the next few weeks. |
This should close #1614.
@steve-chavez I haven't written any tests because I am not sure exactly how configurations are being tested here. And so Codecov is complaining. However, I have tested it locally by giving it an invalid
db-uri
and when thepg server
is not available for which recovery disables successfully. Please review.