-
Notifications
You must be signed in to change notification settings - Fork 897
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
Add a connection timeout for remote region connections #19791
Add a connection timeout for remote region connections #19791
Conversation
This will prevent a non-responsive remote region from hanging the UI when trying to query for the replication backlog. Regular ruby Timeout won't work here because the PG connection code doesn't respond to the exception until after it has exhausted the underlying libpq timeout logic. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1796681
d4354a0
to
8098b63
Compare
Checked commit carbonin@8098b63 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 app/models/pglogical_subscription.rb
|
LGTM. @carbonin do we need to handle this connection timeout differently? In other words, where we'd normally have a regular connection with what I presume is an infinite connection timeout only limited by lower transport layers in the PG gem itself, we'll now have a 5 second timeout whenever we use a remote connection. Will it raise like a normal ruby timeout? |
It will raise, but not a |
Ok, it looks like we ensure around it so it should "ensure" even Exception/non-standard error types will be removed. |
…connection Add a connection timeout for remote region connections (cherry picked from commit 3394f48) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1798523
Hammer backport details:
|
@simaishi can this be backported to |
@carbonin Nothing is needed from you. This will be backported when we start working on the next release. |
…connection Add a connection timeout for remote region connections (cherry picked from commit 3394f48) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1798526
Ivanchuk backport details:
|
This will prevent a non-responsive remote region from hanging
the UI when trying to query for the replication backlog.
Regular ruby Timeout won't work here because the PG connection code
doesn't respond to the exception until after it has exhausted the
underlying libpq timeout logic.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1796681